File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ type configExt struct {
47
47
PublicKey device.NoisePublicKey `json:"public_key"`
48
48
}
49
49
50
+ // NewWithConfig calls New with the given config. For documentation, see New.
50
51
func NewWithConfig (ctx context.Context , logger slog.Logger , cfg Config ) (* Tunnel , error ) {
51
52
err := startUpdateRoutine (ctx , logger , cfg )
52
53
if err != nil {
@@ -112,6 +113,11 @@ allowed_ip=%s/128`,
112
113
}, nil
113
114
}
114
115
116
+ // New creates a tunnel with a public URL and returns a listener for incoming
117
+ // connections on that URL. Connections are made over the wireguard protocol.
118
+ // Tunnel configuration is cached in the user's config directory. Successive
119
+ // calls to New will always use the same URL. If multiple public URLs in
120
+ // parallel are required, use NewWithConfig.
115
121
func New (ctx context.Context , logger slog.Logger ) (* Tunnel , error ) {
116
122
cfg , err := readOrGenerateConfig ()
117
123
if err != nil {
You can’t perform that action at this time.
0 commit comments