FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Send mail with a proxy
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Send mail with a proxy
Posted: Wed May 27, 2015 09:34 AM

Some tried to send a mail (cd0) into a proxy ?
Emg send me this info https://support.microsoft.com/it-it/kb/310233
Some on ecan help me to implement a function to run with proxy on fwh
thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Send mail with a proxy
Posted: Wed May 27, 2015 03:08 PM
Maybe this info from my notes will help.

James

From: "Jeff Davis" <jeff@crednet.com>
Subject: Re: Proxy Client in Fivewin
Date: Monday, November 26, 2001 10:49 AM

I found the solution to my problem.

If you are using TSOCKET to connect to a Port that is not allowed out of the firewall all you have to do is connect to a Proxy server IP with a PORT that is allowed (80 or 8080) and then in the Connect event do the following

nHostPort = 5950
cHostIP = "10.10.10.1"
nProxyPort = 8080
cProxyAddress = "202.89.128.85"

oSocket := CNCSocket():New(nProxyPort)
oSocket:bConnect := { | oSocket | OnConnect(oSocket,oGet)}
oSocket:cDestAddr := cProxyAddress
oSocket:connect()

Function OnConnect(oSocket)
oSocket:SendData("CONNECT "+cHostIP+":"+ltrim(str(nHostPort)+"
HTTP/1.1"+CRLF+ CRLF)
return nil


The proxy server will create a "HTTP tunnel" to cHostIP on nHostPort. You will recieve the following response from the Proxy server.

"HTTP/1.1 200 Connection established
Proxy-agent: CacheFlow-Proxy/1.0"

The 200 means the connection was successfull. All data sent or recieved on the socket connection is now with the new host.

If there is not a proxy to connect to there are MANY "Public Proxy's" on the internet that can be used ( 202.89.128.85:8080 is one).

This works GREAT and was easy to implement in our application. You just need to configure a proxy server IP and Port and if needed, use it to open your socket and then use your hosts IP and port in the "CONNECT " string.

For more info see..
http://www.codeproject.com/internet/httptunneling.asp

--
Jeff Davis
CreditNet Communications
(503) 977-7578
jeff@crednet.com
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion