MCPcopy Index your code
hub / github.com/getlantern/sysproxy / main

Function main

example/example.go:13–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11var log = golog.LoggerFor("example")
12
13func main() {
14 helperFullPath := "sysproxy-cmd"
15 iconFullPath, _ := filepath.Abs("./icon.png")
16 log.Debugf("Using icon at %v", iconFullPath)
17 err := sysproxy.EnsureHelperToolPresent(helperFullPath, "Input your password and save the world!", iconFullPath)
18 if err != nil {
19 fmt.Printf("Error EnsureHelperToolPresent: %s\n", err)
20 return
21 }
22 off, err := sysproxy.On("localhost:12345")
23 if err != nil {
24 fmt.Printf("Error set proxy: %s\n", err)
25 return
26 }
27 fmt.Println("proxy set, hit enter to continue (or kill the parent process)...")
28 var i int
29 fmt.Scanf("%d\n", &i)
30 off()
31}

Callers

nothing calls this directly

Calls 2

EnsureHelperToolPresentFunction · 0.92
OnFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…