469,613 Members | 1,952 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

TcpCLient on Proxy

Recently I found a question online that originated from this group, and
those who responded to it were of no help to the poster. So I am sorry that
I was not watching this group before, but will from now on and will offer my
help as follows to anser the original question.

************************************************** **************************
*******************************************
hi,
I work on a computer that is part of a network and uses proxy to connect to
net. I cant connect to servers outside my proxy with simple ConnectTo code.
I need to know how to make my requests go through proxy. eg,
_socket = new TcpClient("http://msdn.microsoft.com";, port);
does not work.
Thanx.
Ab.
************************************************** **************************
*******************************************

In order to use a prox with TcpClient you will need to pass the proxy server
and port to the TcpClient, like so:

TcpClient tc = new TcpClient(proxhost, proxport);

then you will have to pass your data on the stream.

Now I have only done this with HTTP so depending on what protocol you use
you will have to construct the message with the proper headers and wrappers
and the like.

eg., for HTTP something like this "GET http:wwww.microsoft.com/ http/1.0
\r\n Host: www.microsoft.com \n\n"

It will depend on what protocols your proxy supports. In my company we have
a proxy for HTTP FTP and Telnet.

Once you knw what protocol you will be using you can do the research from
there.

I hope someone finds this helpful. I will be publishing a full article on my
blog and on whatever publication wants to buy the article off me =]

-Evan
Nov 16 '05 #1
0 1376

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by מורדי | last post: by
10 posts views Thread by Abubakar | last post: by
5 posts views Thread by Wal Turner | last post: by
reply views Thread by Tamas Bojcan | last post: by
6 posts views Thread by Julien | last post: by
reply views Thread by aladdinm1 | last post: by
4 posts views Thread by Peter | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.