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

proxy: support dynamic port number #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lelemka0
Copy link

@lelemka0 lelemka0 commented Jan 23, 2025

This PR delays address parsing in some case to make dynamic port numbers work properly.
If dial addresses contains { and }, address parsing in Upstream.provision will be skipped then done later in Handler.dialPeers after all placeholders are replaced, and active health checks will be ignored.

Example Caddyfile:

layer4 {
	:2000 {
		@test tls sni_regexp ^([0-9]{1})\.test$
		route @test {
			proxy {
				upstream 127.0.0.1:800{tls.regexp.1}
			}
		}
	}
}

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

Successfully merging this pull request may close these issues.

2 participants