copy rawSocket codes as init version of http tunnel.