support tunnel and fixed the socket problem