473,372 Members | 1,238 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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.

************************************************** **************************
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.
************************************************** **************************

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

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 =]

Nov 16 '05 #1
0 1577

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: מורדי | last post by:
Hi, I'm writing a client/server application in which the client send a series of screenshots to the server to be saved using the tcpclient. in most cases the first screenshot is transmitted ok...
by: Abubakar | last post by:
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...
by: Wal Turner | last post by:
This has been discussed in a prior thread but there was no solution proposed. Also, using WebRequest is not viable since we need a keep-alive connection. Can anyone provide any information on using...
by: WATYF1 | last post by:
Hello. I'm writing a VB.NET app to check email message counts for both POP3 and IMAP4. I'm using TCPClient to connect, and a NetworkStream to send simple commands. It's a very simple bit of code,...
by: Jim W | last post by:
I have an ASP.NET app that has very slow connect times using TCPClient, or the Socket class, or even calling a COM object that uses C socket calls on certain similar XP SP2 boxes. On those...
by: Tamas Bojcan | last post by:
Hi, I use TcpClient class to obtain a NetworkStream object (via TcpClient's GetStream() method) in an ASP.Net webapp. This works well if I'm not behind proxy server but if I'm connected to the...
by: Julien | last post by:
Hi, I am developing a C# application to send requests to mail server to check email addresses validity. I use a TcpClient object to connect to it with the Connect(String hostname, Int32 port)...
by: aladdinm1 | last post by:
Dear all, I have a client application which working just fine except in one case: when it's behind a proxy. I tested it behind MS ISA with enabled Socks service. I tried everything to make it...
by: Peter | last post by:
Hi I rewrite an old C Programm to C# (Framework 1.1) - it is an easy FTP- Client. I create a "Command-Channel" using TcpClient, a "Command-Reader" and a "Command-Writer" to speak with the FTP...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.