🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #43

How do I use a TIdTCPClient with a HTTP Tunneling Proxy?

#43
From: Ted Lyngmo
Date: Wed, 09 Apr 2008 19:57
53 lines
2351 bytes
Hi!

You wanted to say "Hey, there's a chapter in the Indy knowledge base 
with that title", didn't you? :-)

Well, I read it but it still took an hour before I figured out how to 
use it properly. This mail started out as a question but I figured the 
answer out along the way so I thought I should share my success story. 
Maybe it helps someone...

What I wanted to do:
1. My program (a chat-client) should connect to my webservers standard
    port (80). My webserver: Apache on Linux.
2. Once connected, I wanted my client to issue a (HTTP)CONNECT command
    to connect to port 6666 on my server where a chat-server is
    listening.


This worked:

TIdTCPClient
  Host:      localhost
  Port:      6666
  IOHandler: => TIdIOHandlerStack

TIdIOHandlerStack
  Host:             localhost
  Port:             6666
  TransparentProxy: => TIdConnectThroughHttpProxy

TIdConnectThroughHttpProxy
  Enabled: true
  Host:    myexternalhostname.com
  Port:    80


In http.conf on the server (Apache 1.3):

<IfModule mod_proxy.c>
     ProxyRequests On
     AllowCONNECT 443 563 6666

     <Directory proxy:*>
         Order deny,allow
         Deny from all
         Allow from all    <= could maybe be fine-tuned :-)
     </Directory>
[...]


Cheers,
Ted Lyngmo
Borland C++ Builder 2007 / Indy 10.1.1
Technical Details
Message-ID: <47fd2013$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,672663e3709c592f,start
X-Google-Attributes: gidfeeec,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 09 Apr 2008 21:57:18 +0200
From: Ted Lyngmo <tedREMOVETHIS@lyncon.se>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: sv, en, en-us
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.web
Subject: How do I use a TIdTCPClient with a HTTP Tunneling Proxy?
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 85.195.27.81
Message-ID: <47fd2013$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1207771155 85.195.27.81 (9 Apr 2008 12:59:15 -0700)
Lines: 53
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail