示例#1
0
func enablePAC(pacURL string) {
	log.Printf("Setting firefly as system proxy")
	log.Printf("Serving PAC file at %v", pacURL)
	err := pac.On(pacURL)
	if err != nil {
		log.Printf("Unable to set firefly as system proxy: %s", err)
	}
	atomic.StoreInt32(&isPACOn, 1)
}
示例#2
0
文件: main.go 项目: 2722/lantern
func main() {
	helperFullPath := "pac-cmd"
	iconFullPath, _ := filepath.Abs("./icon.png")
	log.Debugf("Using icon at %v", iconFullPath)
	err := pac.EnsureHelperToolPresent(helperFullPath, "Input your password and save the world!", iconFullPath)
	if err != nil {
		fmt.Printf("Error EnsureHelperToolPresent: %s\n", err)
		return
	}
	err = pac.On("localhost:12345/pac")
	if err != nil {
		fmt.Printf("Error set proxy: %s\n", err)
		return
	}
	fmt.Println("proxy set, Enter continue...")
	var i int
	fmt.Scanf("%d\n", &i)
	pac.Off()
}
示例#3
0
文件: pac.go 项目: shizhh/lantern
func doPACOn() {
	err := pac.On(pacURL)
	if err != nil {
		log.Errorf("Unable to set lantern as system proxy: %v", err)
	}
}