1

My system is accessing internet via a proxy server
(IE proxy server address : myserver.mydomain.com , port: 80).
Im trying to send some data to a TCP server using class "System.Net.Sockets.TcpClient". But i am unable to connect. If I try using static IP internet, i am able to connect.
Is there any way to provide proxy address ? I am pretty sure the problem is the proxy, because i have tried from two systems which do not use proxy and it worked fine. My application is a console application.

My Code is something like :

            TcpClient tcpClient = new TcpClient("tcpserver.com", 3101);
            string message = "message";

            byte[] auditMessageStream;
            auditMessageStream = Encoding.UTF8.GetBytes(message);
            int i = tcpClient.Client.Send(auditMessageStream);
mishal153
  • 1,498
  • 3
  • 26
  • 37

2 Answers2

1

You can use this opensource lib to create a socket conection through a proxy.

Watch this too

Community
  • 1
  • 1
Steven Muhr
  • 3,339
  • 28
  • 46
  • I tried this opensource lib but apparently our proxy is blocking it too. ("bad request. code 400"). Thanks for the info though. – mishal153 Nov 17 '11 at 09:14
0

You need HTTP tunneling unless your proxy is a SOCKS proxy.

dereli
  • 1,814
  • 15
  • 23