New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Awesome code BTW Unexpected response code: 403 #241
Comments
Yes. new Worker('SocketIO://0.0.0.0:'.$port, $opts);
But I can not tell you what problem. Can you give me a public url to test? |
Thanks much for your prompt response, I think eventually I can troubleshoot the problem by looking at your library and attempting to intercept the actual issue .. following your class logic. I found the precise spot where the 403 header is being sent. I just have to start debugging and log the backtrace. Unfortunately, all of my servers are behind a corporate firewall, I am testing the feasibility of several libraries including yours. If I can get a public server running so you can inspect this further, I will let you know. -Jeromy Stewart |
I've traced the error so far to self::ERROR_UNKNOWN_TRANSPORT As for the reason, the following statement evaluates to true if(!isset($req->_query['transport']) In method Engine::verify() Does this help? |
I found an obscure issue in my investigation. If I cause an error right before this line: I can successfully connect and send messages. Otherwise the 403 message prevents connection. I originally caused the error and discovered the issue by attempting to output your serialized $req object as shown below: $file = '/var/log.txt'; This resulted in: Serialization of 'Closure' is not allowed in /var/wmss/workerman/phpsocket.io/src/Engine/Engine.php:110 But because of the error, my web socket connection and subsequent message sending started to work suddenly. Can you help please? |
Okay so I discovered that the error was causing success because it was simply halting the output of the 403 and the method execution was being halted right before the line: this line: $res->writeHead(403, '', $headers); Because of the halt in executing the remaining code, my socket connected successfully. Does this help? |
In your SocketIO chat example I changed one thing/one line
$io = new SocketIO(3000);
When I attempt to connect using my javascript library, I get:
WebSocket connection to 'ws://10.204.1.76:3000/' failed: Error during WebSocket handshake: Unexpected response code: 403
Of course the server address where the php daemon is being executed is: ip a = 10.204.1.76
I've opened port 3000 on the client machine and I have also tested other socket servers that work using the same JavaScript library. They work. If I just simply switch my php script to another library, it connects and broadcasts/emits/sends messages just fine. Because of this, I know that my client firewall ports are appropriately setup and that my ports on the server are allowing port 3000.
I noticed the following line in the SocketIO Class file:
$worker = new Worker('SocketIO://0.0.0.0:'.$port, $opts);
I am guessing this just means "use the servers IP" ?? Is this correct?
Please Help.
Thanks again for this awesome library, I can tell you and your contributors are at the top of the game .. cheers
The text was updated successfully, but these errors were encountered: