Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi all,
I start an inner API server in code-server, something like localhost:8888.
image

I can access success the API through subpath like localhost:8080/proxy/8888 in the browser.
image

But I can not access the API through curl in the terminal. I encounter the error: 'Found. Redirecting to ./../login?to=% '.
image

I think the reason may be the lack of the code-server-session cookie when using the curl. When I add the cookie it works.
image

But I hope I can directly access the API without code-server-session using the curl in the terminal.
How can I solve this problem?
Thanks.

You must be logged in to vote

That makes sense. Right now there is no way to bypass the auth check unfortunately. Eventually we want to add the ability to make a URL public.

For now I think you would need to use something else to proxy the services or remove password authentication (possibly replacing it with some kind of external authentication).

Replies: 3 comments · 4 replies

Comment options

You must be logged in to vote
3 replies
@zhaozhiming
Comment options

Yes. I can directly curl localhost:8888 in the code-server's terminal.
But I want to call its internal services from outside the code-server.
In my use case, I have 2 code-server for 2 different people. One is used to develop the frontend project. The other is used to develop the backend project. And the frontend will invoke the backend API to debug something.

@code-asher
Comment options

That makes sense. Right now there is no way to bypass the auth check unfortunately. Eventually we want to add the ability to make a URL public.

For now I think you would need to use something else to proxy the services or remove password authentication (possibly replacing it with some kind of external authentication).

Answer selected by zhaozhiming
@zhaozhiming
Comment options

Thanks. I will try your way.

Comment options

anything else? how to make it work like these ways:

  1. localhost:8888?cookie=xxxx
  2. localhost:8888?password=xxx. ps. the $password is the same in ~/.config/code-server/config.yaml
You must be logged in to vote
1 reply
@code-asher
Comment options

This is not possible at the moment, but PRs for this are welcome: #3546

Comment options

just use auth=none at confige.yml

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.