Closed xafizoff closed 5 years ago
Not correct, see https://ninenines.eu/docs/en/gun/1.3/manual/gun.connect/#_examples
After the proxy is connected to you can use Gun normally including Websocket.
Thank you for the help. This seems to work:
application:ensure_all_started(gun),
{ok, ConnPid} = gun:open(ProxyHosg,ProxyPort),
{ok, http} = gun:await_up(ConnPid),
StreamRef = gun:connect(ConnPid, #{
host => "websocket-server.example.org",
port => 443,
password => <<"me">>,
username => <<"secret">>,
protocols => [http],
transport => tls
}),
{response, fin, 200, _} = gun:await(ConnPid, StreamRef),
Ref = gun:ws_upgrade(ConnPid,"/ws",[]),
...
Hi.
I'm trying to use
gun
with https proxy.Is that usage correct? Also, is it possible to use CONNECT with websockets? Currently, I'm getting
{error,timeout}
.