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

Webserver home page not showing servers #95

Closed
rianadon opened this issue May 1, 2016 · 10 comments
Closed

Webserver home page not showing servers #95

rianadon opened this issue May 1, 2016 · 10 comments

Comments

@rianadon
Copy link

rianadon commented May 1, 2016

I just installed hotel today, and it looks very cool!
However, after I started hotel and added a server, the webpage stills displays "Welcome, please enjoy your stay! Use hotel command-line to add servers".

Interestingly though, once I run hotel stop, the list with the server's name appears.
I can also still use hotel by navigating to localhost:2000/project.

This happens in both the latest versions of Chrome and Firefox on Windows 10.

Thank you!

@typicode
Copy link
Owner

typicode commented May 1, 2016

Hi @rianadon,

Thanks for the comment and reporting this issue.

I can't seem to reproduce (tried with Chrome, Firefox on Windows 10). If you open the browser dev tools, do you see some errors?

@rianadon
Copy link
Author

rianadon commented May 1, 2016

Thanks for looking into this!

There aren't any errors, but vuex is complaining that an action is not a function (see below).

screenshot 5

Could this be the error?

Upon further inspection, the problem seems to be with the /_/events url, which completes when I manually stop hotel. I tried listening in on the event stream through following code in devtools, then tried adding new hotel servers.

var source = new EventSource('/_/events');
source.addEventListener('message', function(e) {
  console.log(e.data);
}, false);

When adding new servers nothing appeared, but once I ran hotel stop, the console filled up with messages.

Then, I used telnet to fake an http request to /_/events, and I got text!
So maybe the Node.js script is formatting the text stream incorrectly?

@typicode
Copy link
Owner

typicode commented May 1, 2016

Thanks for doing these tests. Maybe it's related to the version of Node used? What's your version?
I assume that you get this error by going to http://localhost:2000 and not http://hotel.dev.

@rianadon
Copy link
Author

rianadon commented May 1, 2016

Currently I'm on 5.3.0. And yes, I'm using http://localhost:2000.

@rianadon
Copy link
Author

rianadon commented May 1, 2016

I just installed 6.0.0 and I'm still encountering the same problem.
Thanks for the suggestion though!

@typicode
Copy link
Owner

typicode commented May 2, 2016

Weird. I did the test with 6.0.0 too, same OS and browsers.

@rianadon
Copy link
Author

rianadon commented May 3, 2016

I forgot to mention this as I deemed it unimportant, but the computer on which hotel is not working is in fact running a Windows Insiders Build (14332).

Since I tried installing hotel on a regular Windows build (same node version) and it worked, I guess this is either somehow related to my specific machine or the different build of Windows (but I have no idea why 😕 ).


Moving on, the /_/events endpoint is definitely the problem. It displays as loaded in the chrome dev tools on the working computer but displays as pending on the computer with the Insiders build.

  1. I wrote a quick program to simulate an HTTP request to /_/events, and both computers output almost the same result (the only difference is the date header), so the stream is being generated correctly.

  2. I also tried testing the stream with the nodejs eventsource library (which the connect-sse library uses for testing), and it works!

  3. So, thinking this was a problem with Chrome or Firefox or Node.js, I tried running the Node.js example from this HTML5 Rocks article, which uses almost the same code as hotel, and that works!

  4. I just tested the connect-sse module with the same versions of Express and that module, and they both work.

  5. I'm able to reproduce this now with a simple example. See this gist.

  6. I've found the issue (at least in my example). The event stream only works if the hostname parameter is not supplied to server.listen. I'm now completely baffled.

    See my simpler test on the gist for more details. Now I have no idea if this is an issue with node, express, or connect-sse.

  7. So I went back to the earlier Node.js example from the HTML5 Rocks article and added 'localhost' after the port number, and the example stopped working! So I guess this is an issue with Node.js itself and not hotel.


I'll update this comment as I do more testing, and I guess if you are able to you could try running hotel on a computer with a Windows Insider Preview.

@rianadon
Copy link
Author

rianadon commented May 3, 2016

As I mentioned in my previous comment, this seems to be related to an issue with Node.js and the Windows Insider build and not hotel. Thank you so much for trying to help resolve the issue!

@typicode
Copy link
Owner

typicode commented May 3, 2016

Awesome job figuring everything out (didn't even know about Windows Insider), thank you!

@rianadon
Copy link
Author

rianadon commented May 4, 2016

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants