networking - C# Socket: connect to server through proxy server -
VS 2008
I am using the following code to find out if the client is using our SIP Can connect to server. Although it was working fine, the customer changed the network there and now my application is to connect to SIP server from behind the proxy server.
The error I get is:
"Connection attempt failed because the connected party did not respond properly after a period of time, or installed The connection was unsuccessful because the connected host failed to respond to xxx.xxx.xx.xx: xx "
This code was working fine, as long as I was behind the proxy server Do not have to connect.
I could not see any properties there so that I can add the proxy address to the socket.
Am I missing something?
Many thanks for any suggestions,
Public Bole IsSIPServer Available () {bool is available = true; Socket Sock = New Socket (Address Family.Inter Network, SocketType.Stream, ProtocolType.Tcp); Try {sock.Connect ("xxx.xxx.xx.xx", xx); } Hold (SocketException pre) {Console.WriteLine (ex.Message); Is available = false; } Hold (Exception Pre) {Console.WriteLine (ex.Message); Is available = false; } Finally {if (zurb connect) {sock.Close (); }} Return is available; }
See my answer, maybe this will be useful General idea first connection to a proxy Use HTTP context command to install, and then open another TCP connection for a host and port.
Comments
Post a Comment