Question

TCP/IP via http connection

Asked by: matelindonesia

Hi Experts,
I'm going to make client server program which is separated by internet clouds, the problem is, client program must use http connection to build connection to the server so it can break trough  the firewall, with assumption that firewall allow the http connection.
Any one can helpme how to make them?

regards

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2005-07-13 at 03:49:48ID21489680
Topic

Delphi Programming

Participating Experts
6
Points
500
Comments
23

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. TCP/IP
    I am planning to write a massive real-time, multithreaded, dataintensive game server in C on Linux. I know functionality for TCP/IP use is built in, but I don't know how to use it. A function like "int SendUdpPacket(int port char *data);" would be ideal. Also, th...
  2. breaking up of TCP/IP packets
    I am hoping for some clarification on when TCP/IP packets are broken up. That is which machines decide to break up a transmission, and then send the frames. For example lets say I am sending a command from terminal A(on a LAN) to server A over the internet. Are these the o...
  3. TCP/IP
    What does "/" in TCP/IP mean? does it mean or, and or something else?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: mikelittlewoodPosted on 2005-07-13 at 04:40:45ID: 14429871

Have you tried using the Indy Components that come with Delphi?

You can find a lot of information and demo apps at http://www.indyproject.org

 

by: RadikalQ3Posted on 2005-07-13 at 07:28:52ID: 14431361

You can use sockets, using http port (port 80), but for avoid firewall problems, the client must initiate the connection with the server.

If you have a webserver that can runs scripts (writen in Delphi, php or any other languaje), the easiest communication is use a Indy http client component and get urls calling to the scripts and pass to the scripts parameters for send data to the server.

What kind of client/server application is? what data will be send/received?

 

by: mnasmanPosted on 2005-07-13 at 08:53:19ID: 14432512

Have you consider using web services?

it's will work on Http and firewall friendly

 

by: matelindonesiaPosted on 2005-07-13 at 10:52:15ID: 14433752

Hi guys,
thank's for all of the comment, I really appreciate., application that I want to build is client server program which connected using tcp/ip connection, so they will be always connected, scuch as yahoo mesangeer,etc.
The problem of using tcp/ip connection is, sometimes firewall or architecture in client side doesn't allways allow tcp/ip connection.

Is the solution as simple as changing port to 80?

regards

 

by: RadikalQ3Posted on 2005-07-13 at 22:07:37ID: 14437952

Normally, the personal's firewall works discriminate by program.
The personal firewalls is not a problem (is a user's option), the problem is the network firewalls (corporate networks, companies, etc) that works by ports, and is not a user option, is an network administrator option.
Is the user can navigate with a browser (directly, without using a proxy) the user can use the 80 (http) port for OUTPUT (that is your case).

 

by: AFZDeveloperPosted on 2005-07-14 at 11:33:09ID: 14443739

Solution 1. use the "connect" command of ssl protocol if firewall not blocked ssl port.
Solution 2. your program server must be http server to get then http packet
and your client program (that it is running on user computer) must be http client
and in interval time send packet to check status server and get requested information over
http protocol.

 

by: matelindonesiaPosted on 2005-07-14 at 20:06:36ID: 14447483

Hi Radikal03,
That's right, what I meant by firewall is the networks firewall, and usually client terminal can navigate with browser directly, but the problem is usually the administraotr only allowing HTTP/HTTPS protocol, and as far as I know, I can't use those protocl to build real time connection as what I can do by using socket connection (TCP/IP).

I've read some interesting article about HTTP tunnelling, but I still can't figured out how to implement it using delphi?

 

by: AFZDeveloperPosted on 2005-07-15 at 00:30:03ID: 14448357

matelindonesia!
use my Solution 2.

 

by: EugeneK-biruzaPosted on 2005-07-15 at 01:52:46ID: 14448749

Did you try ICS (Internet Components Suite) - http://www.devarchive.com/f1340.html ?
It's free with sources. I used it recently and it looks very nice

 

by: matelindonesiaPosted on 2005-07-15 at 01:59:22ID: 14448788

Hi AFZDeveloper,
Sorry for being late giving response of yours, actually I've made client-server program which used your method (number 2), but I need something more realtime, just what tcp/ip based program, but still can run with some limitation environment, and that is the usage of Http/s protocol.

 

by: RadikalQ3Posted on 2005-07-15 at 02:34:32ID: 14448988

Sorry, I have never seen firewall that it discriminates protocols... only ports and IPs... (and maybe some kind of packets)
So that firewall can discriminate protocols, it would have to inspect the content that is sent through the connection.  I have never seen firewall thus.
I have done serveral programs that use tcp/ip connection trought the port 80 (witch a propietary protocol) and never had problems with firewalls...
Sorry, maybe my knowdeledge in this area is limited...

Via Google, I have found documents related this technique, called "HTTP Tunneling" and also "Port 80 Cloaking".
Consist in 'simulate' a http client-server conversation in order to be able to deceive to the firewall.
If this is you case, you can make this using indy http components (client and server) and using geturl in the client for get data and post (or get) method to send data to the server (with the loss of performance that that would entail with all the redundand data to be send&receive)

Or... you can also use a tcp/ip connection but... adding to the send data frames a copy of the the simplest http conversation between a http server and a http client for "simulate" the http protocol (I dont know the level of severity of that firewalls or how can they discriminate the http data).

 

by: matelindonesiaPosted on 2005-07-15 at 03:00:23ID: 14449113

Hai radikal03,
I think you're right about firewall, it just discriminates Ip an port, but how if the client side terminal connect to outside world via proxy server which can discriminate protocols, for exmaple yahoo masenger, there's connection preference which decide whether use no proxy,http proxy or socket proxy, can you give me an explanation what should I do to make such application like that? coz I didn't see any proxy property in Indy TCP component?

 

by: RadikalQ3Posted on 2005-07-15 at 03:18:39ID: 14449204

Ya, Ok.
You are talkink about a proxy connection, not a firewall...
In this case, tcpip indy connection havent got a proxy property because is not neccesary...

The rest of indy clients yes, have an proxy property to override the port... the client request the web page to the proxy trought a different port (by example port 8080) and then the proxy request the web page to the remote server trought the http port (80) and send it back to the client.

A proxy is not a transparent thing... its yo say: a http proxy server, listen in a port but, connect to outside using a different port, but it interprets the request... for example for make a web cache, deny a list of illegal urls, etc...

By example, a proxy can be listen the 8080 port, and, if it permits the connection, this request is made to the outside via 80 port, so... you tcpip indy component must use the proxy port, instead of use the direct port, but... an http proxy is not a bouncer... dont pass any kind of data, insted of this, the proxy is like a web server, make a conversation with the client so... is not valid for your propietary tcp/ip connection, unless the your disguises of ' HTTP conversation'...

I repeat this... if you want connect trought proxyes & firewalls, you must make you connection like a Web Explorer talking with a web server, and, in the middle... send and receive your data...

 

by: matelindonesiaPosted on 2005-07-17 at 20:45:31ID: 14463636

Ok then...,
let's talk about technical issue, can you show me what kind of component I can use to make tcp/ip connection through proxy port, or maybe if using existing default indy component, what should I've do to override those connect function with server via proxy server?

regards

 

by: RadikalQ3Posted on 2005-07-18 at 00:33:19ID: 14464179

You can make this with the standard http client & server Indy Components.
You can use any demo of idhttpserver and start working with it.

By example, this is a simple web server done with a TidHttpServer.
Simply put this in the OnCommandGet event:

procedure TForm1.IdHTTPServer1CommandGet(AThread: TIdPeerThread;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  html         : String;
  TheResponse  : string;
begin

  //Default response
  TheResponse:= 'No response for the commnad: '+ARequestInfo.Document;


  //Commands discriminate the request by the url requested
  if ARequestInfo.Document='/time' then begin
    TheResponse:='The time is:'+TimeToStr(Now);
  end;

  if ARequestInfo.Document='/date' then begin
    TheResponse:='The date is:'+DateToStr(Now);
  end;

  if ARequestInfo.Document='/command1' then begin
    TheResponse:= 'This is the answer for command1, and the params: '+ARequestInfo.UnparsedParams;
  end;

  AResponseInfo.ContentType := 'text/HTML';

  //Generate the response:
  html := '<html><head><title>Server Response</title></head><body>'+
          TheResponse+
          '</body></html>';
  AResponseInfo.ContentText := html;
end;

Now, you can test it, accesing to 'http://localhost' with you internet browser.
If you get the URL:  'http://localhost/time', the server will return the time of the server, id you request the URL 'http://localhost/date', the server will return the server's date, and if you request http://localhost/command1?parameter="Aparameter"&parameter2="OtherParameter" the server will return a copy of the command requested.
You can test it with your internet browser, and this will work in a client accesing to your server trought a proxy.... if he can navigate trought web pages, he can navigate trought your indy server.
Now, you can use Indy http client to make a private connection, for interactuate with your server.
Instead of request '/time', you can request... anything, and returns... anything, so... you have a valid connection for request & answer commands between your applications.
And... instead of connect trought 80 port, the client must connect with the proxy port (8080 is the usual port).
You can also use Post method for a longer send data capacity (the Get method is limited in long)

 

by: matelindonesiaPosted on 2005-07-19 at 19:35:30ID: 14481193

Hi RadikalO3,
Thanks for your code, but it is works on HTTTP protocol, what I mean after all is tcp/ip connection, just like chat program, but it can through proxy server, if use abovementioned code, than it was in http protocol.

 

by: RadikalQ3Posted on 2005-07-19 at 22:14:22ID: 14481671

Hufff...the code is a example of web server made with Indy.
We are talking about http tunneling trought http proxys no?, this example can send and receive data between two applications trought a http proxy server.
If you can connect trught a http proxy server, you cant use a tcp/ip connection, you must pass the data like http requests.
I think that this was clear in previous comments...

 

by: EugeneK-biruzaPosted on 2005-08-01 at 03:24:53ID: 14568608

Is you question answered?

 

by: matelindonesiaPosted on 2005-08-07 at 21:12:55ID: 14620738

No not yet Eugene-biruza,
but I've found a component http tunnel for delphi, HTTPort by Dmitry Dvoinikov
That's exactly what I mean by http tunneling

 

by: EugeneK-biruzaPosted on 2005-08-08 at 23:32:46ID: 14630259

matelindonesia,
glad to see that you resolved your problem. WHere did you find the HTTPort component? I'd like to look at it too :-)

 

by: EugeneK-biruzaPosted on 2005-09-06 at 00:19:06ID: 14827180

Is your problem resolved? Maybe it would be fair to split points between guys who tried to help?

 

by: elvin66Posted on 2006-01-05 at 16:15:31ID: 15624878

No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
NOTE: As the author has NOT responded to expert request on where he found the component this is my recommendation
[PAQ - Split Points - 250 Afdeveloper - 250 RadikalQ3]

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

[Elvin]
EE Cleanup Volunteer

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...