2023-08-12 16:41:26 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-08-13 23:22:48 -04:00
|
|
|
"context"
|
2023-08-12 16:41:26 -04:00
|
|
|
"encoding/json"
|
|
|
|
"log"
|
2023-08-13 16:19:23 -04:00
|
|
|
"os"
|
2023-08-12 16:41:26 -04:00
|
|
|
|
2023-08-13 16:19:23 -04:00
|
|
|
"dynatron.me/x/windport/pkg/windscribe"
|
2023-08-12 16:41:26 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2023-08-13 16:19:23 -04:00
|
|
|
a := windscribe.Auth{}
|
2023-08-12 16:41:26 -04:00
|
|
|
err := json.NewDecoder(os.Stdin).Decode(&a)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2023-08-13 23:22:48 -04:00
|
|
|
c := windscribe.New()
|
|
|
|
ctx := context.Background()
|
2023-08-12 16:41:26 -04:00
|
|
|
|
2023-08-13 23:22:48 -04:00
|
|
|
err = c.Auth(ctx, a)
|
2023-08-12 16:41:26 -04:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
2023-08-13 23:22:48 -04:00
|
|
|
err = c.MatchingPort(ctx)
|
2023-08-12 16:41:26 -04:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|