summaryrefslogtreecommitdiffhomepage
path: root/tunnel/tools/libwg-go/http-proxy.go
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-07-05 22:48:28 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2023-07-06 01:44:49 +0200
commitc7553c3ba4c6718ad6c626ede9085bae51dfc5bf (patch)
treec6afbbeecdd9731a20f9e4fc528a435c5ded42b2 /tunnel/tools/libwg-go/http-proxy.go
parent9d82a08950c3c1504024e4faf7026e482e46f071 (diff)
WIP: add cap to grpc
Diffstat (limited to 'tunnel/tools/libwg-go/http-proxy.go')
-rw-r--r--tunnel/tools/libwg-go/http-proxy.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/tunnel/tools/libwg-go/http-proxy.go b/tunnel/tools/libwg-go/http-proxy.go
index 9c457286..241c7f7d 100644
--- a/tunnel/tools/libwg-go/http-proxy.go
+++ b/tunnel/tools/libwg-go/http-proxy.go
@@ -451,6 +451,8 @@ func (p *HttpProxy) SetPacFileUrl(pacFileUrl *url.URL) error {
p.ctx.Destroy()
}
p.ctx = ctx
+ p.logger.Verbosef("SetNotMetered(false) from SetPacFileUrl")
+ p.SetNotMetered(false)
return nil
}
@@ -465,6 +467,23 @@ func (p *HttpProxy) SetPacFileContent(pacFile string) error {
p.ctx.Destroy()
}
p.ctx = ctx
+ p.logger.Verbosef("SetNotMetered(false) from SetPacFileContent")
+ p.SetNotMetered(false)
+ return nil
+}
+
+func (p *HttpProxy) SetNotMetered(notMetered bool) error {
+ p.logger.Verbosef("SetNotMetered: %v", notMetered)
+
+ if p.ctx == nil {
+ return fmt.Errorf("No ductape context")
+ }
+
+ p.ctx.PushGlobalObject()
+ p.ctx.PushBoolean(notMetered)
+ p.ctx.PutPropString(-2, "notMetered")
+ p.ctx.Pop()
+
return nil
}