Files
windscribe-proxy/main.go
2021-06-24 02:07:19 +03:00

46 lines
716 B
Go

package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/Snawoot/windscribe-proxy/wndclient"
)
func main() {
wndc, err := wndclient.NewWndClient(nil)
if err != nil {
panic(err)
}
err = wndc.RegisterToken(context.TODO())
if err != nil {
panic(err)
}
err = wndc.Users(context.TODO())
if err != nil {
panic(err)
}
err = wndc.ServerCredentials(context.TODO())
if err != nil {
panic(err)
}
fmt.Printf("Username = %s\nPassword = %s\n", wndc.ProxyUsername, wndc.ProxyPassword)
list, err := wndc.ServerList(context.TODO())
if err != nil {
panic(err)
}
enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")
err = enc.Encode(list)
if err != nil {
panic(err)
}
}