473,804 Members | 3,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TCPClient on Proxy

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.

Nov 16 '05
10 25144
Abubakar wrote:
now we are getting somewhere.
You see you have mentioned "TcpClient/TcpListener" yourself. I have
made pretty nice multiclient, rooms enabled, multi-threaded chat apps
before as experiments, so I have the basic understanding of the
client-server applications. Now I'v been doing that by using classes
that you mentioned which are "TcpClient/TcpListener" and others like
networkstream etc. But one of the app that I was trying to make which
would enable me to be in contact with my home pc anywhere I go,
through my mobile or through a desktop pc. I'm making the desktop
version in C# and *will* make the mobile version in Java :( cuz the
mobile I got uses a symbian OS and no .net is available for that.
Note: You should post your problem to a networking group, like
comp.os.ms-windows.network ing.tcp-ip or
microsoft.publi c.windowsxp.net work_web. This is more a problem of setting up
your infrastructure.
Anyway, so I use the TcpClient to make a connection at an IP say
x.x.x.x, but my problem was, due to which i started this thread, that
I'm on a network and the ip that I give for connection is alway *not
found* or *host unreachable* becuz ofcourse I'm on a network and
directly mentioning, inside the network, an IP which is outside the
network is not found.
So I guess you're talking about a home LAN that is connected to the Internet
by some broadband router performing NAT?
So now I needed a way through which my tcplient
becomes intelligent enough to automatically resolve that IP through
the proxy, but it doesnt.


Your client would talk to the proxy, which in turn talks to the real
application server. A proxy does not resolve addresses for the public. But
anyway, you'll need some network component that is permanently visible on
the Internet, for example by using DynDNS with a compatible router. You
could either expose your server directly (not a good idea) or use a proxy.

Cheers,

--
Joerg Jooss
jo*********@gmx .net

Nov 16 '05 #11

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

Similar topics

3
3052
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 and arrives at the server but from after that i only a couple of KB from the start of the file which cases the picture to display only the very top (of the screen). All the pictures are saved at the client side before sent to the server and they...
5
6146
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 the TCPClient class (or other) via proxies and whether or not this is possible? Regards Wwal
0
1638
by: Evan Freeman[C++ Samuri] | last post by:
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...
4
4477
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, actually... the problem is, if the user is behind a proxy, then the Connect method fails (times out). How do I get around this? I thought this would be a common issue and that there would be plenty of code out there to demonstrate how to...
5
2749
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 boxes, if another connection is made within a couple seconds, it is fast. Running the same C# code in a console app connects instantly. Unplugging the network cable allows localhost connections to be instant (?!). Running the same ASP.NET app on...
0
1363
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 network via proxy server I get "dead network..." error message during the creation of the TcpClient object. The most strange thing is that the same code is works well with proxy too if it is in a single C# project. What's the problem in case of...
6
5724
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) method. When I use my application at home I don't have any problem to connect and get responses but when I try at work, I get the SocketException number 10061 : "target machine actively refused it". I don't have any proxy, maybe a firewall.
0
1575
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 connect from behind the proxy but, it failed. I'm using .Net Framework 2.0 and it looks like it does not support Socks proxies. Is there any solution for this problem? Thanks in advance.
4
9173
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 Server coChannel = new TcpClient(this.HostName, this.Port); coReader = new StreamReader(coChannel.GetStream());
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.