mirror of
https://github.com/boringproxy/boringproxy.git
synced 2025-02-25 18:55:29 -06:00
31 lines
373 B
Go
31 lines
373 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
|
|
if len(os.Args) < 2 {
|
|
fmt.Println("Invalid arguments")
|
|
os.Exit(1)
|
|
}
|
|
|
|
command := os.Args[1]
|
|
|
|
switch command {
|
|
case "server":
|
|
log.Println("Starting up")
|
|
Listen()
|
|
|
|
case "client":
|
|
client := NewBoringProxyClient()
|
|
client.Run()
|
|
default:
|
|
fmt.Println("Invalid command " + command)
|
|
os.Exit(1)
|
|
}
|
|
}
|