I want to develop a WebSocket backend for WeChat applets in PHP. The backend runs properly in the localhost test, but when I put it onto the Alibaba Cloud server, I get the error prompt “Establishing a tunnel via proxy server failed”. I checked the IP address, domain name and port (allowed in security group settings) and confirmed they were correct. I started xdebug debugging in an attempt to locate the cause, and the process was always interrupted when the socket_select function was run. I found several different code samples from the Internet, and their results turned out the same: the test runs normally in localhost, but fails on Alibaba Cloud servers. The xdebug debugging always got interrupted when it came to the socket_select function. The following are screenshots of two code samples:

Additionally, if I run the shell command “netstat -anpt|grep 9000” on the server prior to the debugging process proceeding to the socket_select function, I found the set Port 9000 was already in Listen status.
Can anybody help to locate the cause? In advance, thanks a million!
j
stuff ;)
did you try to move xdebug to a different port? you could do a SSH tunnel with a port-forward to your local machine as well? did you try both of those things already?