Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


tcp client  connecting trough proxy server

Posted on 2003-11-18
Medium Priority
Last Modified: 2010-04-05

can annyone tel me how to use proxy servers in the tcpclient of indy,
I know http and other indy components have proxy settings.

never worked with proxy servers so please can someone give me a hint
Question by:henk29
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3

Accepted Solution

gmayo earned 500 total points
ID: 9777286
I'm not sure you need to explicitly state that you are using a proxy server. For example, my PC is set up to use a proxy at work, and I do not need to give the address of the proxy server, just the target address (this is using TClientSocket rather than Indy). If the Windows internet connection is set up properly, then presumably something in the routing table means it knows how to get to the target address.

Geoff M.

Author Comment

ID: 9783081
Well the problem is at some networks it needs to have to proxy set and a username and password, otherwise it returns the message unknow host or unable to connect, i know you have to do something with the tcp header to make it work but the question is how?

Expert Comment

ID: 9785855
TCP is a low level comms channel, just a pipe literally. The HTTP and other components sit on top of TCP and actually form a high level protocol using that pipe. You will probably only be able to communicate directly with the proxy server at TCP level, not anything beyond the proxy. The proxy acts as a kind of agent, getting stuff for you. HTTP makes this seamless so it appears as if you are talking to the outside world when, in fact, you are only talking to the proxy which itself does the talking with the outside world.

I'm not sure how I can explain it any better.

Geoff M.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 9786289
Ok it makes sense,

but still doesn;t awnser my question
im using these components for a client server solution and i need to communicate trough a proxy
so i just need to get it working so is there a way to code that the client is able to go trough the proxy
i read something about using socks and thats prob what messenger and other programs use
so im looking for some code or example to connect to a fix ip on the web over tcp

Expert Comment

ID: 9786432
Okay, you need to know which protocol you are using. For example, if you were to connect to a standard web page, you'd need to implement the HTTP protocol. If you were to connect to a RealAudio site you'd need RMS. For mail you need SMTP or POP3. It all depends on what you are connecting to. Basically, you send a message to the proxy saying "get me this" but in a language that the proxy can forward to the host server. The format of that message will be different depending on the protocol.

There are too many unknowns in your question to be able to answer it. What you are trying to do is low level and you'd probably be re-inventing the wheel. Why not use a component which probably already exists (HTTP, POP3, etc)?

Geoff M.

Author Comment

ID: 9786490
ok damm

well the server and client are made by me so i have control over both
what i basicly use is tcp client and tcpserver from indy
what happens is that the client loges in to the server and they communicate with each other
the client will be used with home users and ofcourse at businisses..
i'm sending xml data packeges over to communicate,
so what would you advice then


Expert Comment

ID: 9786577
Sorry, I'm not familiar with XML. If you do a google search for XML and Delphi you should find something which meets your needs. Sorry I can't help further.

Geoff M.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question