update the proxy code to resolve a route by the client token and the client-side peer name

This commit is contained in:
2025-08-24 19:00:26 +09:00
parent e2a3180ec7
commit c8cb71cf95
4 changed files with 106 additions and 26 deletions

View File

@ -191,7 +191,7 @@ func (pxy *server_pxy) Authenticate(req *http.Request) (int, string) {
// ------------------------------------
func prevent_follow_redirect (req *http.Request, via []*http.Request) error {
func prevent_follow_redirect(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
}
@ -289,7 +289,7 @@ func (pxy *server_pxy_http_main) serve_upgraded(w http.ResponseWriter, req *http
return err
}
func (pxy *server_pxy_http_main) addr_to_transport (ctx context.Context, addr *net.TCPAddr) (*http.Transport, error) {
func (pxy *server_pxy_http_main) addr_to_transport(ctx context.Context, addr *net.TCPAddr) (*http.Transport, error) {
var dialer *net.Dialer
var waitctx context.Context
var cancel_wait context.CancelFunc
@ -318,7 +318,7 @@ func (pxy *server_pxy_http_main) addr_to_transport (ctx context.Context, addr *n
}, nil
}
func (pxy *server_pxy_http_main) req_to_proxy_url (req *http.Request, r *ServerRouteProxyInfo) *url.URL {
func (pxy *server_pxy_http_main) req_to_proxy_url(req *http.Request, r *ServerRouteProxyInfo) *url.URL {
var proxy_proto string
var proxy_url_path string
@ -568,7 +568,7 @@ func (pxy *server_pxy_ssh_ws) Identity() string {
// TODO: put this task to sync group.
// TODO: put the above proxy task to sync group too.
func (pxy *server_pxy_ssh_ws) connect_ssh (ctx context.Context, username string, password string, r *ServerRoute) (*ssh.Client, *ssh.Session, io.Writer, io.Reader, error) {
func (pxy *server_pxy_ssh_ws) connect_ssh(ctx context.Context, username string, password string, r *ServerRoute) (*ssh.Client, *ssh.Session, io.Writer, io.Reader, error) {
var cc *ssh.ClientConfig
var addr *net.TCPAddr
var dialer *net.Dialer