Skip to content
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

NW closes when creating http server and showing devtools #327

Closed
shycherry opened this issue Jan 9, 2013 · 1 comment
Closed

NW closes when creating http server and showing devtools #327

shycherry opened this issue Jan 9, 2013 · 1 comment
Milestone

Comments

@shycherry
Copy link

--package.json--
{
"name": "server",
"description": "server",
"version": "0.1",
"nodejs":true,
"node-main": "main.js",
"main": "index.html",
"window": {
"show": true,
"toolbar": true,
"fullscreen":false
}
}

--main.js--
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

--index.html--
nw rocks !

running that with node-webkit v0.3.7 on windows 7 x64 :

  • nw launches as expected and a http request from any other browser to localhost:1337 returns the "hello world" content as expected
  • when clicking devtool button, NW closes without any prompt

please note that if I call the .listen function of the server after displaying devtools, things are running well (no unexpected closes when opening devtools)

@rogerwang
Copy link
Member

The error was EADDRINUSE, it's caused by the new renderer process for devtools trying to execute the main.js script again and found the port is being used.

I'll fix this by not running main.js in devtools. And you can use a workaround to launch the server from index.html before the fix is released with the next version.

owenc4a4 added a commit to owenc4a4/node-webkit that referenced this issue Jan 16, 2013
rogerwang added a commit that referenced this issue Jan 16, 2013
Test case for #327, a module call app test, revise node-remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants