Solved

tcp client  connecting trough proxy server

Posted on 2003-11-18
9
577 Views
Last Modified: 2010-04-05
hi,

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
0
Comment
Question by:henk29
  • 4
  • 3
9 Comments
 
LVL 8

Accepted Solution

by:
gmayo earned 125 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.
0
 

Author Comment

by:henk29
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?
0
 
LVL 8

Expert Comment

by:gmayo
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.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

 

Author Comment

by:henk29
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
0
 
LVL 8

Expert Comment

by:gmayo
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.
0
 

Author Comment

by:henk29
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

0
 
LVL 8

Expert Comment

by:gmayo
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.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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