mohammed90 / caddy-ngrok-listener

Caddy listener_wrapper to automatically listen on an ngrok tunnel
Apache License 2.0
20 stars 2 forks source link

[ngrok ConnectionOption] WithProxyURL #6

Closed jtszalay closed 11 months ago

jtszalay commented 1 year ago

Various connection options have yet to be surfaced. This is one of them.

// https://github.com/ngrok/ngrok-go/blob/main/session.go
// WithProxyURL configures the session to connect to ngrok through an outbound
// HTTP or SOCKS5 proxy. This parameter is ignored if you override the dialer
// with [WithDialer].
//
// See the [proxy url paramter in the ngrok docs] for additional details.
//
// [proxy url paramter in the ngrok docs]: https://ngrok.com/docs/ngrok-agent/config#proxy_url
func WithProxyURL(url *url.URL) ConnectOption

I have an idea for this one which I've implemented on a personal project: starting with type JsonURL string with a UnmarshalJSON method that validates the parsing, i.e. calling url.Parse is without error. It can be tackled later.

_Originally posted by @mohammed90 in https://github.com/mohammed90/caddy-ngrok-listener/pull/2#discussion_r1133627499_