How to debug only socket.io connection without Node.js site in WebStorm/PhpStorm?How do I debug Node.js applications?Response not returned for specific requests when xdebug runningdebugging protactor (with / without webstorm)Socket IO The connection to ws://someAddress was interrupted while the page was loadingPhpstorm, xdebug and vagrant still waiting for incoming connectionHow to debug node.js application with Visual Studio 2013 and Node Tools NTVSBrowser hangs even when no breakpoint is set in XDebug/PHPStormDebug Symfony2 with XDebug and PHPStormPhpStorm + Xdebug: Connection established, no Debug window popup in PhpStormGetting ERR_EMPTY_RESPONSE when listening xdebug connections in PhpStorm

Where are they calling from?

Is this a Sherman, and if so what model?

How can an attacker use robots.txt?

Why is there is no screening for Ovarian Cancer?

Is it a good idea to leave minor world details to the reader's imagination?

Is there any actual security benefit to restricting foreign IP addresses?

My 15 year old son is gay. How do I express my feelings about this?

What was the deeper meaning of Hermione wanting the cloak?

What are the benefits and disadvantages if a creature has multiple tails, e.g., Kyuubi or Nekomata?

How is the problem, G has no triangle in Logspace?

Canonical ordering of days of week

Is it true that, "just ten trading days represent 63 per cent of the returns of the past 50 years"?

Is it more effective to add yeast before or after kneading?

Is it really necessary to have a four hour meeting in Sprint planning?

How does IBM's 53-bit quantum computer compare to classical ones for cryptanalytic tasks?

Is the mass of paint relevant in rocket design?

To what extent is it worthwhile to report check fraud / refund scams?

An Algorithm Which Schedules Your Life

What do you do if you have developments on your paper during the long peer review process?

Worms crawling under skin

Leaving a job that I just took based on false promise of a raise. What do I tell future interviewers?

What benefits does the Power Word Kill spell have?

Guitar tuning (EADGBE), "perfect" fourths?

Performance for simple code that converts a RGB tuple to hex string



How to debug only socket.io connection without Node.js site in WebStorm/PhpStorm?


How do I debug Node.js applications?Response not returned for specific requests when xdebug runningdebugging protactor (with / without webstorm)Socket IO The connection to ws://someAddress was interrupted while the page was loadingPhpstorm, xdebug and vagrant still waiting for incoming connectionHow to debug node.js application with Visual Studio 2013 and Node Tools NTVSBrowser hangs even when no breakpoint is set in XDebug/PHPStormDebug Symfony2 with XDebug and PHPStormPhpStorm + Xdebug: Connection established, no Debug window popup in PhpStormGetting ERR_EMPTY_RESPONSE when listening xdebug connections in PhpStorm






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















I'm developing a site which is in PHP. In this website I'm creating chat. Now problem is that I can't debug properly in WebStorm/PhpStorm.



This is command which I was using now in cmd before



node -r dotenv/config server.js


for debugging I'm using console.log which will write socket server data in cmd and client side socket data in browser console.



I want to shift to IDE debugging. I use PhpStorm and sometimes WebStorm. Both are same in JavaScript handling.



This is configuration I've done in PhpStorm:



Nodejs Debug configuration



The problem is breakpoint is not working on socket receiver in server.js



const express = require("express");
const app = express();
const serverConf = require("./serverConf");
const server = serverConf.createServer(app);
const io = require("socket.io").listen(server, 'pingTimeout': 5000, 'pingInterval': 1000);

serverConf.startServer(server);

io.on("connection", function (socket)
socket.on("admin_send_text", async function(response)
response.admin_id;
console.log(response);
);
);


Breakpoint is on response.admin_id line



Because I'm not using any routes so I can't debug socket connection. It's just move to next line. Like no breakpoint is there.



This is a message I receive in terminal



"C:Program Filesnodejsnode.exe" -r dotenv/config C:xampphtdocsgofashionchatserver.js DEBUG=*
Debugger listening on ws://127.0.0.1:61037/1e06be2f-b94f-41c4-bbc8-a7437dcd2d4d
For help, see: https://nodejs.org/en/docs/inspector


How to do I set breakpoint on socket receiver on server?










share|improve this question


























  • works for me using similar setup - execution is suspended on breakpoint, and I can see received data in the debugger. BTW, you can get more logging from socket.io if you add DEBUG=socket.io* to Environment variables section odf your Node.js run configuration

    – lena
    Apr 2 at 15:21











  • but execution doesn't suspend for me. It keeps going. DEBUG=socket.io* doesn't stop execution

    – Faizan Rupani
    Apr 3 at 14:54











  • ` DEBUG=socket.io*` is not supposed to suspend it, it just enables debug logging. Unfortunately, I can hardly help unless you provide a project that shows up the issue

    – lena
    Apr 3 at 15:36












  • In the configuration described in the queestion the breakpoint will never be reached. Do you call the listener? I'm missing the snippet of code with which you connect to your socket.io-endpoint of your express server. A simple html with [...] io.connect('ws://127.0.0.1:61037'); io.emit('admin_send_text', admin_id: '123456'); [...] should be enough. If desired, I will write an more detailed answer.

    – Sven 31415
    Apr 4 at 18:21












  • Obviously I'm emitting text from client side and it reaches server and continue doing what I have written to do but the problem is that breakpoints doesn't work on that. i.e above mentioned sample "admin_send_text" is called after emitting from client but breakpoint doesn't work on it and also inside callback function

    – Faizan Rupani
    Apr 5 at 10:17


















4















I'm developing a site which is in PHP. In this website I'm creating chat. Now problem is that I can't debug properly in WebStorm/PhpStorm.



This is command which I was using now in cmd before



node -r dotenv/config server.js


for debugging I'm using console.log which will write socket server data in cmd and client side socket data in browser console.



I want to shift to IDE debugging. I use PhpStorm and sometimes WebStorm. Both are same in JavaScript handling.



This is configuration I've done in PhpStorm:



Nodejs Debug configuration



The problem is breakpoint is not working on socket receiver in server.js



const express = require("express");
const app = express();
const serverConf = require("./serverConf");
const server = serverConf.createServer(app);
const io = require("socket.io").listen(server, 'pingTimeout': 5000, 'pingInterval': 1000);

serverConf.startServer(server);

io.on("connection", function (socket)
socket.on("admin_send_text", async function(response)
response.admin_id;
console.log(response);
);
);


Breakpoint is on response.admin_id line



Because I'm not using any routes so I can't debug socket connection. It's just move to next line. Like no breakpoint is there.



This is a message I receive in terminal



"C:Program Filesnodejsnode.exe" -r dotenv/config C:xampphtdocsgofashionchatserver.js DEBUG=*
Debugger listening on ws://127.0.0.1:61037/1e06be2f-b94f-41c4-bbc8-a7437dcd2d4d
For help, see: https://nodejs.org/en/docs/inspector


How to do I set breakpoint on socket receiver on server?










share|improve this question


























  • works for me using similar setup - execution is suspended on breakpoint, and I can see received data in the debugger. BTW, you can get more logging from socket.io if you add DEBUG=socket.io* to Environment variables section odf your Node.js run configuration

    – lena
    Apr 2 at 15:21











  • but execution doesn't suspend for me. It keeps going. DEBUG=socket.io* doesn't stop execution

    – Faizan Rupani
    Apr 3 at 14:54











  • ` DEBUG=socket.io*` is not supposed to suspend it, it just enables debug logging. Unfortunately, I can hardly help unless you provide a project that shows up the issue

    – lena
    Apr 3 at 15:36












  • In the configuration described in the queestion the breakpoint will never be reached. Do you call the listener? I'm missing the snippet of code with which you connect to your socket.io-endpoint of your express server. A simple html with [...] io.connect('ws://127.0.0.1:61037'); io.emit('admin_send_text', admin_id: '123456'); [...] should be enough. If desired, I will write an more detailed answer.

    – Sven 31415
    Apr 4 at 18:21












  • Obviously I'm emitting text from client side and it reaches server and continue doing what I have written to do but the problem is that breakpoints doesn't work on that. i.e above mentioned sample "admin_send_text" is called after emitting from client but breakpoint doesn't work on it and also inside callback function

    – Faizan Rupani
    Apr 5 at 10:17














4












4








4








I'm developing a site which is in PHP. In this website I'm creating chat. Now problem is that I can't debug properly in WebStorm/PhpStorm.



This is command which I was using now in cmd before



node -r dotenv/config server.js


for debugging I'm using console.log which will write socket server data in cmd and client side socket data in browser console.



I want to shift to IDE debugging. I use PhpStorm and sometimes WebStorm. Both are same in JavaScript handling.



This is configuration I've done in PhpStorm:



Nodejs Debug configuration



The problem is breakpoint is not working on socket receiver in server.js



const express = require("express");
const app = express();
const serverConf = require("./serverConf");
const server = serverConf.createServer(app);
const io = require("socket.io").listen(server, 'pingTimeout': 5000, 'pingInterval': 1000);

serverConf.startServer(server);

io.on("connection", function (socket)
socket.on("admin_send_text", async function(response)
response.admin_id;
console.log(response);
);
);


Breakpoint is on response.admin_id line



Because I'm not using any routes so I can't debug socket connection. It's just move to next line. Like no breakpoint is there.



This is a message I receive in terminal



"C:Program Filesnodejsnode.exe" -r dotenv/config C:xampphtdocsgofashionchatserver.js DEBUG=*
Debugger listening on ws://127.0.0.1:61037/1e06be2f-b94f-41c4-bbc8-a7437dcd2d4d
For help, see: https://nodejs.org/en/docs/inspector


How to do I set breakpoint on socket receiver on server?










share|improve this question
















I'm developing a site which is in PHP. In this website I'm creating chat. Now problem is that I can't debug properly in WebStorm/PhpStorm.



This is command which I was using now in cmd before



node -r dotenv/config server.js


for debugging I'm using console.log which will write socket server data in cmd and client side socket data in browser console.



I want to shift to IDE debugging. I use PhpStorm and sometimes WebStorm. Both are same in JavaScript handling.



This is configuration I've done in PhpStorm:



Nodejs Debug configuration



The problem is breakpoint is not working on socket receiver in server.js



const express = require("express");
const app = express();
const serverConf = require("./serverConf");
const server = serverConf.createServer(app);
const io = require("socket.io").listen(server, 'pingTimeout': 5000, 'pingInterval': 1000);

serverConf.startServer(server);

io.on("connection", function (socket)
socket.on("admin_send_text", async function(response)
response.admin_id;
console.log(response);
);
);


Breakpoint is on response.admin_id line



Because I'm not using any routes so I can't debug socket connection. It's just move to next line. Like no breakpoint is there.



This is a message I receive in terminal



"C:Program Filesnodejsnode.exe" -r dotenv/config C:xampphtdocsgofashionchatserver.js DEBUG=*
Debugger listening on ws://127.0.0.1:61037/1e06be2f-b94f-41c4-bbc8-a7437dcd2d4d
For help, see: https://nodejs.org/en/docs/inspector


How to do I set breakpoint on socket receiver on server?







node.js sockets debugging phpstorm xdebug






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 15:54









LazyOne

116k23 gold badges260 silver badges278 bronze badges




116k23 gold badges260 silver badges278 bronze badges










asked Mar 28 at 15:34









Faizan RupaniFaizan Rupani

3261 silver badge16 bronze badges




3261 silver badge16 bronze badges















  • works for me using similar setup - execution is suspended on breakpoint, and I can see received data in the debugger. BTW, you can get more logging from socket.io if you add DEBUG=socket.io* to Environment variables section odf your Node.js run configuration

    – lena
    Apr 2 at 15:21











  • but execution doesn't suspend for me. It keeps going. DEBUG=socket.io* doesn't stop execution

    – Faizan Rupani
    Apr 3 at 14:54











  • ` DEBUG=socket.io*` is not supposed to suspend it, it just enables debug logging. Unfortunately, I can hardly help unless you provide a project that shows up the issue

    – lena
    Apr 3 at 15:36












  • In the configuration described in the queestion the breakpoint will never be reached. Do you call the listener? I'm missing the snippet of code with which you connect to your socket.io-endpoint of your express server. A simple html with [...] io.connect('ws://127.0.0.1:61037'); io.emit('admin_send_text', admin_id: '123456'); [...] should be enough. If desired, I will write an more detailed answer.

    – Sven 31415
    Apr 4 at 18:21












  • Obviously I'm emitting text from client side and it reaches server and continue doing what I have written to do but the problem is that breakpoints doesn't work on that. i.e above mentioned sample "admin_send_text" is called after emitting from client but breakpoint doesn't work on it and also inside callback function

    – Faizan Rupani
    Apr 5 at 10:17


















  • works for me using similar setup - execution is suspended on breakpoint, and I can see received data in the debugger. BTW, you can get more logging from socket.io if you add DEBUG=socket.io* to Environment variables section odf your Node.js run configuration

    – lena
    Apr 2 at 15:21











  • but execution doesn't suspend for me. It keeps going. DEBUG=socket.io* doesn't stop execution

    – Faizan Rupani
    Apr 3 at 14:54











  • ` DEBUG=socket.io*` is not supposed to suspend it, it just enables debug logging. Unfortunately, I can hardly help unless you provide a project that shows up the issue

    – lena
    Apr 3 at 15:36












  • In the configuration described in the queestion the breakpoint will never be reached. Do you call the listener? I'm missing the snippet of code with which you connect to your socket.io-endpoint of your express server. A simple html with [...] io.connect('ws://127.0.0.1:61037'); io.emit('admin_send_text', admin_id: '123456'); [...] should be enough. If desired, I will write an more detailed answer.

    – Sven 31415
    Apr 4 at 18:21












  • Obviously I'm emitting text from client side and it reaches server and continue doing what I have written to do but the problem is that breakpoints doesn't work on that. i.e above mentioned sample "admin_send_text" is called after emitting from client but breakpoint doesn't work on it and also inside callback function

    – Faizan Rupani
    Apr 5 at 10:17

















works for me using similar setup - execution is suspended on breakpoint, and I can see received data in the debugger. BTW, you can get more logging from socket.io if you add DEBUG=socket.io* to Environment variables section odf your Node.js run configuration

– lena
Apr 2 at 15:21





works for me using similar setup - execution is suspended on breakpoint, and I can see received data in the debugger. BTW, you can get more logging from socket.io if you add DEBUG=socket.io* to Environment variables section odf your Node.js run configuration

– lena
Apr 2 at 15:21













but execution doesn't suspend for me. It keeps going. DEBUG=socket.io* doesn't stop execution

– Faizan Rupani
Apr 3 at 14:54





but execution doesn't suspend for me. It keeps going. DEBUG=socket.io* doesn't stop execution

– Faizan Rupani
Apr 3 at 14:54













` DEBUG=socket.io*` is not supposed to suspend it, it just enables debug logging. Unfortunately, I can hardly help unless you provide a project that shows up the issue

– lena
Apr 3 at 15:36






` DEBUG=socket.io*` is not supposed to suspend it, it just enables debug logging. Unfortunately, I can hardly help unless you provide a project that shows up the issue

– lena
Apr 3 at 15:36














In the configuration described in the queestion the breakpoint will never be reached. Do you call the listener? I'm missing the snippet of code with which you connect to your socket.io-endpoint of your express server. A simple html with [...] io.connect('ws://127.0.0.1:61037'); io.emit('admin_send_text', admin_id: '123456'); [...] should be enough. If desired, I will write an more detailed answer.

– Sven 31415
Apr 4 at 18:21






In the configuration described in the queestion the breakpoint will never be reached. Do you call the listener? I'm missing the snippet of code with which you connect to your socket.io-endpoint of your express server. A simple html with [...] io.connect('ws://127.0.0.1:61037'); io.emit('admin_send_text', admin_id: '123456'); [...] should be enough. If desired, I will write an more detailed answer.

– Sven 31415
Apr 4 at 18:21














Obviously I'm emitting text from client side and it reaches server and continue doing what I have written to do but the problem is that breakpoints doesn't work on that. i.e above mentioned sample "admin_send_text" is called after emitting from client but breakpoint doesn't work on it and also inside callback function

– Faizan Rupani
Apr 5 at 10:17






Obviously I'm emitting text from client side and it reaches server and continue doing what I have written to do but the problem is that breakpoints doesn't work on that. i.e above mentioned sample "admin_send_text" is called after emitting from client but breakpoint doesn't work on it and also inside callback function

– Faizan Rupani
Apr 5 at 10:17













0






active

oldest

votes














Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55401523%2fhow-to-debug-only-socket-io-connection-without-node-js-site-in-webstorm-phpstorm%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55401523%2fhow-to-debug-only-socket-io-connection-without-node-js-site-in-webstorm-phpstorm%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript