spdy-http2 / node-spdy

SPDY server on Node.js
2.81k stars 196 forks source link

showing No data received on browser #86

Closed TheRiseOfNewEra closed 11 years ago

TheRiseOfNewEra commented 11 years ago

Hi indutny, I am created an example with node spdy, and created keys, the server is running but shows error message "No data received" Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

will you please tell me how to fix it???????????

Thanks in advance.

indutny commented 11 years ago

What node.js version are you using? Can you please post here exact code that you're using for spdy server and tell me the way how you're testing it.

TheRiseOfNewEra commented 11 years ago

Thanks for reply. node.js version I am using is v0.8.22

The code is as follows

var fs = require('fs'); var spdy = require('spdy');

console.log('Server running on Process Id :'+process.version ); var options = { key: fs.readFileSync('keys/ryans-key.pem'), cert: fs.readFileSync('keys/ryans-cert.pem'), ca: fs.readFileSync('keys/ryans-csr.pem') //windowSize: 1024 };

var server = spdy.createServer(options, function(request, response) { console.log('In spdy................'); response.writeHead(200, { "Content-Type": "text/plain" }); response.end("Hello World!\n"); });

server.listen(5000, function(){ console.log("SPDY Server started on 5000"); });

and I am accessing it remotely...by adding port no 5000 and it shows me error message it's not printing the console console.log('In spdy................');

No data received Unable to load the webpage because the server sent no data. Here are some suggestions: Reload this webpage later. Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

indutny commented 11 years ago

I guess you was trying to access http://localhost:8000/. Could you please try opening https://localhost:8000/ instead?

TheRiseOfNewEra commented 11 years ago

Oops! Google Chrome could not connect to https://localhost:8000/ showing this message. in above example the server connection get successful but the page not get display. it display this message on console but not console.log('In spdy................');

indutny commented 11 years ago

Err, sorry... not 8000, 5000 : https://localhost:5000/.

TheRiseOfNewEra commented 11 years ago

Showing this message. This webpage is not available Google Chrome's connection attempt to localhost was rejected. The website may be down, or your network may not be properly configured.

indutny commented 11 years ago

I've just tried running absolutely the same code and it works just fine, are you sure that your node.js server is running? Is it running on your laptop/computer (locally) or on some remote server?

TheRiseOfNewEra commented 11 years ago

I am working remotely my laptop accessing remote server by giving portno:5000 and it doesn't display any information just shows the message "No data received"

I am not getting node.js server running means? when I am running this example it's too running.

indutny commented 11 years ago

OK. Important part here is that you should add https:// to the left side of address of your server. If you're accessing it via my-super-remote-server.com:5000 try https://my-super-remote-server.com:5000/.

TheRiseOfNewEra commented 11 years ago

got it boss.

really really thanks.

indutny commented 11 years ago

np, be my guest.

johnnycamby commented 10 years ago

nodejs server returns "node js server No data received" on the browser ,

indutny commented 10 years ago

@johnnycamby no question asked - no answer given.