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

Styleguidist server not accessible from another host than localhost #669

Closed
ghost opened this issue Nov 6, 2017 · 9 comments
Closed

Styleguidist server not accessible from another host than localhost #669

ghost opened this issue Nov 6, 2017 · 9 comments
Labels

Comments

@ghost
Copy link

ghost commented Nov 6, 2017

I develop on one machine, but I test on another one.
I can't access styleguidist from my test machine because I receive "Invalid host header".

I looks like the server only answers on 0.0.0.0.

Would it be possible to configure this when starting the server ?
Thanks !

@sapegin
Copy link
Member

sapegin commented Nov 6, 2017

Do you know how to configure webpack-dev-server for that? It supposed to be accessible with 0.0.0.0 instead of localhost.

But actually it works for me, I’ve just tried to follow the instructions:

> styleguidist server

You can now view style guide in the browser.

Local:            http://localhost:6060/

On your network:  http://11.22.33.44:6060/

and was able to open the style guide from by phone, both are in the same network.

@ghost
Copy link
Author

ghost commented Nov 6, 2017

Indeed, when I use the ip of the dev machine directly (in your example http://11.22.33.44:6060/) it works.
However, when I use a hostname (example "xyz" pointing to 11.22.33.44) via /etc/hosts, it doesn't work when trying to access http://xyz:6060.

Anyway, not a bit deal, as I can use the ip of the machine directly, which I didn't try before :(

@sapegin
Copy link
Member

sapegin commented Nov 6, 2017

Looks like you need to use the public option for dev server and we shouldn’t do this by default because it would open style guide server for everyone:

webpack/webpack-dev-server#882

@ghost
Copy link
Author

ghost commented Nov 6, 2017

Not by default of course, but maybe that could be an option in the styleguide.config.js ?

@sapegin
Copy link
Member

sapegin commented Nov 6, 2017

You can change any webpack dev server options via devServer option in webpack config.

@ghost
Copy link
Author

ghost commented Nov 6, 2017

Thanks ! Problem solved.

@ghost ghost closed this as completed Nov 6, 2017
@sapegin
Copy link
Member

sapegin commented Nov 6, 2017

Would be nice if you could add this info to the docs though ;-)

@sapegin
Copy link
Member

sapegin commented Nov 6, 2017

Not about devServer but how to make a server accessible from the internet.

@ghost
Copy link
Author

ghost commented Nov 6, 2017

Pull request created:
#671

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

No branches or pull requests

1 participant