Skip to content

Commit

Permalink
Use new pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna committed May 28, 2024
1 parent 6096e5a commit cd88555
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions x/examples/fetch-psiphon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ func main() {
if err != nil {
log.Fatalf("Failed to load Psiphon config: %v\n", err)
}
dialer, err := config.NewDialer(context.Background())
if err != nil {
log.Fatalf("Could not create dialer: %v\n", err)
dialer := psiphon.GetSingletonDialer()
if err := dialer.Start(context.Background(), config); err != nil {
log.Fatalf("Could not start dialer: %v\n", err)
}
defer dialer.Close()
defer dialer.Stop()
dialContext := func(ctx context.Context, network, addr string) (net.Conn, error) {
return dialer.DialStream(ctx, addr)
}
Expand Down

0 comments on commit cd88555

Please sign in to comment.