Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
TFPHTTPClient with proxy and HTTPS protocol
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Does anyone have experien...
by
Gustavo 'Gus' Carreno
[
Today
at 04:05:42 am]
The issue of the scroll b...
by
jianwt
[
Today
at 03:27:12 am]
Why does $fpctarget not w...
by
Gustavo 'Gus' Carreno
[
Today
at 03:18:16 am]
"Mario & Luigi" (1994-200...
by
Gustavo 'Gus' Carreno
[
Today
at 01:46:38 am]
TMemoryStream Question wi...
by
Schmitty2005
[
Today
at 01:22:29 am]
GitHub action setup-lazar...
by
Gustavo 'Gus' Carreno
[
Today
at 01:03:07 am]
How to control subform: S...
by
Wilko500
[
Today
at 12:09:23 am]
A minor issue with the TR...
by
cdbc
[July 15, 2025, 11:44:52 pm]
activex.pp DosDateTimeToV...
by
440bx
[July 15, 2025, 11:16:33 pm]
Line Numbers, own System ...
by
Martin_fr
[July 15, 2025, 10:05:31 pm]
use Macro defines with Pa...
by
PascalDragon
[July 15, 2025, 10:03:21 pm]
generic Class for any Typ...
by
PascalDragon
[July 15, 2025, 09:53:18 pm]
Asking for an example of ...
by
marcov
[July 15, 2025, 09:39:58 pm]
Problems with libraries f...
by
regs
[July 15, 2025, 08:23:36 pm]
THUMBBUTTON does not work...
by
ASerge
[July 15, 2025, 08:10:40 pm]
Record Locked
by
Thaddy
[July 15, 2025, 07:28:38 pm]
tSQLQuery.UpdateSQL with ...
by
JRBleau
[July 15, 2025, 07:15:19 pm]
RichMemo's contents heigh...
by
dpap
[July 15, 2025, 06:13:22 pm]
Is Lazarus still serious ...
by
Thaddy
[July 15, 2025, 05:39:02 pm]
How to prevent text to be...
by
CM630
[July 15, 2025, 05:13:13 pm]
Has anyone installed TeeB...
by
Thaddy
[July 15, 2025, 05:04:07 pm]
fpc in [home] folder not ...
by
Gustavo 'Gus' Carreno
[July 15, 2025, 03:54:17 pm]
Setting up an ARM embedde...
by
Ruptor
[July 15, 2025, 03:06:39 pm]
Groupview Partial loading...
by
matthius
[July 15, 2025, 02:37:07 pm]
[Solved]Setting with hori...
by
PeterHu
[July 15, 2025, 12:32:44 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TFPHTTPClient with proxy and HTTPS protocol (Read 11114 times)
Abelisto
Jr. Member
Posts: 91
TFPHTTPClient with proxy and HTTPS protocol
«
on:
August 03, 2018, 05:26:24 am »
Is the subj possible? If yes - how?
There is the simple test program:
Code: Pascal
[Select]
[+]
[-]
program
proxy
;
{$mode objfpc}{$H+}
uses
Classes
,
SysUtils
,
openssl
,
fphttpclient
;
procedure
SetProxy
(
AHttp
:
TFPHTTPClient
;
const
AUrl
:
string
)
;
var
i
:
Integer
;
begin
with
AHttp
.
Proxy
do
begin
if
AUrl <>
''
then
begin
i
:
=
Pos
(
':'
,
AUrl
)
;
Host
:
=
Copy
(
AUrl
,
1
,
i
-
1
)
;
Port
:
=
StrToInt
(
Copy
(
AUrl
,
i
+
1
,
Length
(
AUrl
)
)
)
;
UserName
:
=
''
;
Password
:
=
''
;
Writeln
(
ErrOutput
,
Format
(
'Set proxy Host: %s, Port: %d'
,
[
Host
,
Port
]
)
)
;
end
else
begin
Host
:
=
''
;
Port
:
=
0
;
UserName
:
=
''
;
Password
:
=
''
;
end
;
end
;
end
;
var
url
,
proxy
:
string
;
http
:
TFPHTTPClient
;
responce
:
string
;
begin
if
ParamCount >
1
then
begin
proxy
:
=
ParamStr
(
1
)
;
url
:
=
ParamStr
(
2
)
;
end
else
begin
proxy
:
=
''
;
url
:
=
ParamStr
(
1
)
end
;
http
:
=
TFPHttpClient
.
Create
(
nil
)
;
http
.
IOTimeout
:
=
5000
;
SetProxy
(
http
,
proxy
)
;
responce
:
=
http
.
Get
(
url
)
;
Writeln
(
responce
)
;
http
.
Free
;
end
.
Next calls works just fine:
./proxy 185.93.3.123:8080
http://www.lazarus-ide.org
./proxy
https://www.lazarus-ide.org
curl --proxy 185.93.3.123:8080
https://www.lazarus-ide.org
But
./proxy 185.93.3.123:8080
https://www.lazarus-ide.org
gives
ESocketError: Connect to 185.93.3.123:8080 failed.
«
Last Edit: August 03, 2018, 07:34:23 am by Abelisto
»
Logged
OS: Linux Mint + MATE, Compiler: FPC trunk (yes, I am risky!), IDE: Lazarus trunk
Thaddy
Hero Member
Posts: 17441
Ceterum censeo Trumpum esse delendum (Tnx Charlie)
Re: TFPHTTPClient with proxy and HTTPS protocol
«
Reply #1 on:
August 03, 2018, 12:29:38 pm »
Well. Use trunk for that. There have been quite a few changes including a related one with an example in the last few weeks.
Logged
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.
Abelisto
Jr. Member
Posts: 91
Re: TFPHTTPClient with proxy and HTTPS protocol
«
Reply #2 on:
August 03, 2018, 02:12:41 pm »
@Thaddy Thanks, but it seems that the result is same, even with
packages/fcl-web/examples/httpclient/httpget.pas
example.
Logged
OS: Linux Mint + MATE, Compiler: FPC trunk (yes, I am risky!), IDE: Lazarus trunk
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Networking and Web Programming
»
TFPHTTPClient with proxy and HTTPS protocol
TinyPortal
© 2005-2018