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

Can custom forward_proxy for caddy2 support multi basic-auth config #137

Closed
bash99 opened this issue Oct 13, 2020 · 5 comments
Closed

Can custom forward_proxy for caddy2 support multi basic-auth config #137

bash99 opened this issue Oct 13, 2020 · 5 comments

Comments

@bash99
Copy link

bash99 commented Oct 13, 2020

which is fine in caddy1.

But I got error message like this:
run: adapting config using caddyfile: parsing caddyfile tokens for 'route': Caddyfile_vx:13 - Error during parsing: parsing caddyfile tokens for 'forward_proxy': Caddyfile_vx:7 - Error during parsing: Multi-user
basicauth is not supported

which with

    basicauth user1 pass1
    basicauth user2 pass2

Configs

@mattieross
Copy link

try

    basic_auth user1 pass1
    basic_auth user2 pass2

@bash99
Copy link
Author

bash99 commented Oct 13, 2020

try

    basic_auth user1 pass1
    basic_auth user2 pass2

I use @mixcool's binary before build one for myself, his binary is basicauth. but this is not the problem.

I've found upstream forward_proxy don't support multi-user
https://github.com/caddyserver/forwardproxy/blob/caddy2/forwardproxy.go:731

			// TODO: Support multiple basicauths.
			if h.BasicauthUser != "" || h.BasicauthPass != "" {
				return d.Err("Multi-user basicauth is not supported")
			}

@beeperman
Copy link

beeperman commented Mar 25, 2021

Maybe not a good fix but I think you can just use multiple forward_proxy calls to achieve it. Something like

forward_proxy {
basic_auth user1 pass1
hide_ip
hide_via
probe_resistance
}
forward_proxy {
basic_auth user2 pass2
hide_ip
hide_via
probe_resistance
}

@klzgrad
Copy link
Owner

klzgrad commented Apr 28, 2021

This issue should be redirected to upstream caddyserver/forwardproxy#81.

@klzgrad
Copy link
Owner

klzgrad commented Feb 18, 2024

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

4 participants