#1 2025-05-28 08:12:59

Alek
Member
From: Russia
Registered: 2014-07-04
Posts: 62

THttpClientSocket.OpenBind

Hello

After the function appears "THttpClientSocket.OpenBind" in the unit mormot.net.client i can't connect to remote local server, because a function try to do it through proxy server
I have a description of the proxy server in the environment variables, but i don't use them. I am accessing the server directly by IP address.

Without this function all works fine

What am I doing wrong?

Last edited by Alek (2025-05-28 09:49:35)

Offline

#2 2025-05-28 10:43:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,025
Website

Re: THttpClientSocket.OpenBind

On which OS?
With which environment variables?

Offline

#3 2025-05-28 10:47:54

Alek
Member
From: Russia
Registered: 2014-07-04
Posts: 62

Re: THttpClientSocket.OpenBind

OS Windows, variables: HTTP_PROXY, HTTPS_PROXY, value http://localhost:3128

Offline

#4 2025-05-28 12:22:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,025
Website

Re: THttpClientSocket.OpenBind

OpenBind() does not use the system proxy.
OpenOptions() does.
And you can easily disable the proxy in OpenOPtions() by using 'none' as proxy URI parameter.

Are you sure you are using OpenBind()?

Offline

#5 2025-05-28 12:36:12

Alek
Member
From: Russia
Registered: 2014-07-04
Posts: 62

Re: THttpClientSocket.OpenBind

procedure THttpClientSocket.OpenBind(const aServer, aPort: RawUtf8; doBind,
  aTLS: boolean; aLayer: TNetLayer; aSock: TNetSocket; aReusePort: boolean);
  //------- TLS=false; Tunnel.Server='localhost'; Tunnel.Server <> 'ip address'  - and go to inside
  //bak=Tunnel (the same proxy data)

Offline

#6 2025-05-28 12:41:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,025
Website

Re: THttpClientSocket.OpenBind

This is what I meant.

OpenBind() receives the Tunnel value from somewhere else.
I guess from OpenOptions() or any other high-level function or method.
There, you should be able to set 'none' as proxy parameter, and disable the proxy for this URI.

OR, you could use the new global DefaultHttpClientSocketProxyNotForIp4:
https://github.com/synopse/mORMot2/commit/f1d5940ee

Offline

#7 2025-05-28 12:46:47

Alek
Member
From: Russia
Registered: 2014-07-04
Posts: 62

Re: THttpClientSocket.OpenBind

This is the stack

#0 THttpClientSocket.OpenBind(THttpClientSocket($03DDEF98)
#1 THttpClientSocket.OpenOptions(THttpClientSocket($03DDEF98),
#2 TSimpleHttpClient.RawConnect(TSimpleHttpClient($008F33FC),
#3 TSimpleHttpClient.Request(TSimpleHttpClient($033F99C0),
#4 TJsonClient.RawRequest(TJsonClient($00348150),
#5 TJsonClientAbstract.RttiRequest(TJsonClientAbstract($00348150),
#6 TJsonClientAbstract.Request
#7 TOpenapiClient...


update:

this code JsonClient.Http.Options.Proxy:='none';    works for me

Last edited by Alek (2025-05-28 12:58:48)

Offline

Board footer

Powered by FluxBB