I was using mux before, but found some problem it cannot deal with. 
I will clean up the codes after a while.
We need both http and https support. I am going to abstract that layer out.