From 6d50dde1bb2eb8fd63e4543000b0b6ad0272cc67 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 24 Feb 2023 23:55:03 +0100 Subject: tunnel: download pac in java --- tunnel/tools/libwg-go/http-proxy.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tunnel/tools/libwg-go/http-proxy.go') diff --git a/tunnel/tools/libwg-go/http-proxy.go b/tunnel/tools/libwg-go/http-proxy.go index c73e1edf..9c5a1036 100644 --- a/tunnel/tools/libwg-go/http-proxy.go +++ b/tunnel/tools/libwg-go/http-proxy.go @@ -445,6 +445,20 @@ func (p *HttpProxy) SetPacFileUrl(pacFileUrl *url.URL) error { return nil } +func (p *HttpProxy) SetPacFileContent(pacFile string) error { + ctx := newPacBodyCtx(pacFile, p.logger) + + for _, handler := range(p.handlers) { + handler.setPacCtx(ctx) + } + + if p.ctx != nil { + p.ctx.Destroy() + } + p.ctx = ctx + return nil +} + func (p *HttpProxy) Start() (listen_port uint16, err error) { p.logger.Verbosef("HttpProxy.Start()") listen_port = 0 -- cgit v1.2.3