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
Recent
Convert string with Key-V...
by
Bart
[
Today
at 08:07:00 pm]
Wikipedia pollution
by
bytebites
[
Today
at 07:55:53 pm]
How to register a windows...
by
LeoBruno
[
Today
at 07:43:09 pm]
$ifdef highlighting
by
Thaddy
[
Today
at 07:26:54 pm]
Lazarus Trunc & macOS Tah...
by
Thaddy
[
Today
at 05:00:57 pm]
"F2": possible bug in IDE...
by
WooBean
[
Today
at 04:14:47 pm]
Please ask about the valu...
by
dseligo
[
Today
at 03:34:20 pm]
Need help converting a C+...
by
jamie
[
Today
at 03:18:52 pm]
TurboBird IBX
by
maurog
[
Today
at 02:56:32 pm]
Problem with TSQLQuery
by
sch61
[
Today
at 02:53:10 pm]
append new record to arra...
by
Warfley
[
Today
at 02:28:36 pm]
Lazarus broke my project
by
LatinoDaddy
[
Today
at 02:21:02 pm]
How to use nested classes
by
Thaddy
[
Today
at 02:03:44 pm]
Publish a LAMW app in F-d...
by
Joris
[
Today
at 01:49:23 pm]
Help with a TPages and TA...
by
AlexTP
[
Today
at 12:01:24 pm]
randomrange
by
BubikolRamios
[
Today
at 10:36:19 am]
Synedit wordwrap
by
Martin_fr
[
Today
at 09:42:04 am]
How to load read large CS...
by
Xenno
[
Today
at 05:43:10 am]
Uno, working demo (comput...
by
TBMan
[
Today
at 04:18:51 am]
[solved] fishing problem ...
by
speter
[
Today
at 03:36:39 am]
problen updating lazarus ...
by
LatinoDaddy
[
Today
at 02:48:20 am]
Need help with compiling ...
by
dbannon
[
Today
at 01:02:16 am]
Hints in TTrayIcon
by
dbannon
[
Today
at 12:44:28 am]
FindWindow seems to not w...
by
rca
[
Today
at 12:41:30 am]
Anyone interested in help...
by
ad1mt
[December 05, 2025, 09:41:40 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: TFPHTTPClient with proxy and HTTPS protocol (Read 11316 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: 18490
Here stood a man who saw the Elbe and jumped it.
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