Home use is radio and television network, connected without line, in 192.168.1.1 is configured port forwarding, 9001 forwarding to 192.168.1.101, and then the corresponding configuration in the php.ini xdebug, phpstorm boot monitoring, the result was disappointed, I set the breakpoint does not have any reaction, did not get the slightest debug information, in the look at the network link, Phpstorm really is in 9001 listening, came to the server Tail-f/root/xdebug.log received from the local request, but the returned information can not be reached, Then decided that my network address has a problem, call the radio and television customer service, sure enough, our dial-up is indeed assigned a separate IP but, this IP is in a local area network, because radio and television is leased the line of telecommunications, how to do? Write your own forwarding, I heard that Nodejs do these work is very silly, do not bother to win socket or Linux socket, of course, the premise is all installed Nodejs
Linux:
varNET = require (' net ');varUtil=require (' Util ');varSock1;varSock2;varServer = Net.createserver (function(c) {//' Connection ' listenersock1=C; Console.log (' Client Connected '); Console.log (' Remoteaddr= ' +c.remoteaddress); Console.log (' remoteport= ' +c.remoteport); Console.log (‘------------------------------‘); C.on (' End ',function() {Console.log (' Client Disconnected '); }); C.on (' Data ',function(data) {Console.log (' Data received '); Console.log (data); Console.log (‘------------------------‘); Sock2.write (data); });}); Server.listen (8124,function() {//' listening ' listenerConsole.log (' Server start ');});varserver9001 = Net.createserver (function(c) {Sock2=C; C.on (' Data ',function(data) {Console.log (' Data from ' +c.remoteaddress+ ': ' +c.remoteport); Console.log (data); Console.log ("--------------------------------"); Sock1.write (data); });}); Server9001.listen (9001,function() {Console.log (' server9001 start ');});
Win7
varNET = require (' net ');varHOST = ' 115.28.200.122 ';varPORT = 8124;varPhpstorm =NewNet. Socket ();varProxyclient =NewNet. Socket ();p Hpstorm.connect (9001, ' localhost ',function() {Console.log ("Phpstorm Connected"); Console.log (‘--------------------------‘);}); Proxyclient.connect (PORT, HOST,function() {Console.log (' Proxyclient CONNECTED to: ' + HOST + ': ' +PORT); Console.log (‘--------------------------‘);}); Proxyclient.on (' Data ',function(data) {Console.log ("Proxyclient Data Received"); Console.log (data); Console.log ("----------------------------------"); Phpstorm.write (data);}); Proxyclient.on (' Close ',function() {Console.log (' Connection closed ');}); Phpstorm.on (' Data ',function(data) {Console.log (' Phpstorm data received '); Console.log (data); Console.log ("------------------------------"); Proxyclient.write (data);});
Phpstorm Intranet Remote Debug