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

{"message":"You are not authorized"} in GitHub Codespace #864

Closed
davetapley opened this issue Aug 21, 2023 · 2 comments
Closed

{"message":"You are not authorized"} in GitHub Codespace #864

davetapley opened this issue Aug 21, 2023 · 2 comments

Comments

@davetapley
Copy link

davetapley commented Aug 21, 2023

Environment Versions

  1. OS Type
  2. Node version: v18.17.1
  3. http-server version: v14.1.1

Steps to reproduce

  1. Start a GitHub Codespace
  2. npx http-server
  3. Codespace will auto-forward port 8080

Expected result

Navigate to http://localhost:8080/ in browser and see files

Actual result

Navigate to http://localhost:8080/ and see:

{"message":"You are not authorized"}

...

Other information

I'm not 100% sure if this is http-server or Codespace, but I figured I'd open in case others see / can reproduce.

If I curl localhost:8080 in the Codespace I can see the listing just fine, and https://ngrok.com/ works too.

See also: https://github.com/orgs/community/discussions/64558

@zbynek
Copy link
Contributor

zbynek commented Aug 21, 2023

For me it works with empty codespace (which by default has Node 20 -- not sure if that could be different to Node 18).

Navigate to http://localhost:8080/ in browser and see files

Note that the URL in browser address bar needs to be something like https://foo-bar-baz-8080.app.github.dev/ -- if you actually try to open localhost in your browser it won't work.

Also: when you're running http-server in terminal, you should see a log of all the URLs that were served -- does it produce any output when you try to open the codespace URL in a browser?

@davetapley
Copy link
Author

@zbynek well that's embarrassing, I also cannot repro in an empty Codespace, because:

I just realized there's already a different web-server running on 8080 on my other Codespace,
but weirdly I didn't get a Error: listen EADDRINUSE: address already in use 0.0.0.0:8080 when trying to start http-server 🤔

The other server is defined via dockerComposeFile in the devcontainer.json. I'll do some more digging, but probably safe to say not a http-server issue...

@davetapley davetapley closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2023
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