예제 #1
0
func disablePAC() {
	if atomic.CompareAndSwapInt32(&isPACOn, 1, 0) {
		log.Printf("Unsetting firefly as system proxy")
		err := pac.Off()
		if err != nil {
			log.Printf("Unable to unset firefly as system proxy: %s", err)
		}
		log.Printf("Unset firefly as system proxy")
	}
}
예제 #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 doPACOff() {
	err := pac.Off()
	if err != nil {
		log.Errorf("Unable to unset lantern as system proxy: %v", err)
	}
}