mholt / caddy-dynamicdns

Caddy app that keeps your DNS records (A/AAAA) pointed at itself.
Apache License 2.0
251 stars 25 forks source link

Use UPnP Load instead of discovery if endpoint is specified #65

Closed lenke182 closed 8 months ago

lenke182 commented 8 months ago

To speed up external IP querying with UPnP, upnp.Load(location) with a static UPnP location can be used instead of the default UPnP discovery. The location can be specified in the Caddyfile as ip_source upnp http://192.168.1.1/.... If this endpoint is not specified, then the standard UPnP discovery is used.

When using upnp.Load(location), only HTTP messages are send to the network gateway. Therefore, if Caddy is used inside a docker container, Caddy doesn't need direct access to the host network (--network host).

The location for the Caddyfile can be identified by using upnpc -s (apt install miniupnpc).

mholt commented 8 months ago

Thanks for the contribution! I guess this is a good idea