Change Socket to TcpClient for supporting https