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

Server should listen on localhost #89

Closed
AgDude opened this issue Sep 16, 2020 · 4 comments
Closed

Server should listen on localhost #89

AgDude opened this issue Sep 16, 2020 · 4 comments

Comments

@AgDude
Copy link

AgDude commented Sep 16, 2020

Currently the "server" option inspects the host ip address. It is typical for development tools to listen on localhost. This is a feature request to provide an option to listen on localhost or to specify the address on which to listen instead of inspecting to the network interfaces.

@lukejpreston
Copy link
Owner

It should be listening to the localhost

The message logged is just a message it doesn't do anything with that value https://github.com/lukejpreston/xunit-viewer/blob/master/src/cli/server.js#L30

Unless you are referring to something else?

@AgDude
Copy link
Author

AgDude commented Sep 16, 2020

When I point the browser at http://127.0.0.1:3000/ I get the message "This site can’t be reached". When I use the link from the console I am able to load the page. I am using WSL on windows, but other development tools (karma, various dev server) work as expected with this setup.

The command I am using is yarn xunit-viewer -r my-project/test-reports -o my-project/test-reports/junit.html -s -w

@lukejpreston
Copy link
Owner

That library for the console log is here https://www.npmjs.com/package/ip and the server uses koa and socket.io.

The reason for using the IP library is because not everyone has access to the machine's localhost; if you consider running it form a docker container or virtual machine and the user has not mapped up to the machine host then localhost wouldn't work

I found this which leads me to think it isn't Xunit Viewer at fault microsoft/WSL#2471 there is also microsoft/WSL#4353 where people are still experiencing a recent bug with WSL

I am not really sure how to help sorry, I don't have a windows machine. If you want to spend the time debugging, could you create a hello world koa app and run it using WSL and see if it has the same issue?

How do you run karma and other dev tools, then I can see what libraries they use and if there is a solution to this problem. From my experience, I have run karma from VSCode only and I don't know how VSCode interacts with WSL.

@AgDude
Copy link
Author

AgDude commented Sep 21, 2020

I haven't read all of the details on the WSL issues, but combined with this microsoft/WSL#4769, I agree, this i most likely a WSL issue and not a xunit-viewer issue. I am closing this now. Thanks for the explanation and for looking into it.

@AgDude AgDude closed this as completed Sep 21, 2020
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