Closed Devian1988 closed 3 years ago
Hi, thx for report. Have u tried to test it? What's the result, can u post the result?
https://www.infoq.com/articles/Web-Sockets-Proxy-Servers/ If a browser is configured to use an explicit proxy server then it will first issue the HTTP CONNECT method to that proxy server while establishing the WebSocket connection. For example, to connect to the server example.com using the ws:// scheme (typically over port 80), the browser client sends the HTTP CONNECT method shown in Example 2 to the proxy server.
Example 2—HTTP CONNECT method using port 80
CONNECT example.com:80 HTTP/1.1
Host: example.com
When the explicit proxy server allows the CONNECT method, the WebSocket connection upgrade handshake can be made and when that handshake succeeds, WebSocket traffic can start flowing unimpeded through the proxy server.
and with ssl If a browser is configured to use an explicit proxy server then it will first issue an HTTP CONNECT method to that proxy server while establishing the WebSocket connection. For example, to connect to the server example.com using the wss:// scheme (typically over port 443), the browser client sends the HTTP CONNECT method shown in Example 3 to the proxy server.
CONNECT example.com:443 HTTP/1.1
Host: example.com
When the explicit proxy server allows the CONNECT method, the TLS handshake is sent, followed by the WebSocket connection upgrade handshake. After those handshakes succeed, WebSocket traffic can start flowing unimpeded through the proxy server. HTTPS (HTTP over TLS) work the same way; the use of encryption typically triggers the HTTP CONNECT method.
Everythink you say is right but: You dont send the target host to the Proxy in CONNECT Request. You send the proxy address.
It is now:
$write = "CONNECT {$this->config->getProxyIp()}:{$this->config->getProxyPort()} HTTP/1.1\r\n";
and has to be:
$write = "CONNECT {$this->config->getHost()}:{$this->config->getPort()} HTTP/1.1\r\n";
Yes, I can make diff on git - thank u very much, may I ask u a reasonable questions again? Have u tried to test it? What's the result, can u post the result? Please provide full information - proxy settings, server, etc
I test against a proxy from fineproxy.de so i have not much informations about it. It gave me an "403 Access Denied" as i tried.
An the Proxy seams to have another Problem related to the WebSocket upgrade Request. It gaves me the Response code "0". But i think this is just because the Proxy disallow WebSockets at the moment. May i ask you: Do you know a Proxy Hoster that allow it? I'm googleing since 2 Hours now ;)
I'm closing this issue because it is not related to web socket proxy connection it-self, but rather to access denied with specific auth params login/password which should be set in php-wss
correctly like this:
$config->setProxyAuth('proxyUser', 'proxyPass');
Hi,
in File WscMain and method proxy() i can see, that you send a CONNECT Request to the Proxy Server itselfs. Shouldn't it be the target Host (Line 135)?
For my undeerstanding otherwise the Messages are not sendet to the Target Host.
Regards