mirror of
https://github.com/Snawoot/windscribe-proxy.git
synced 2026-04-11 21:38:15 +00:00
46 lines
716 B
Go
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)
|
|
}
|
|
}
|