Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (23 sloc) 819 Bytes

UPnP Library for Racket

What is it

This is a Racket library for discovering, accessing and invoking UPnP services.

How it (should) work:

(define d (upnp-discovery))
(define s (upnp-search-service-srvid d "urn:upnp-org:serviceId:WANIPConn1"))
(define c (upnp-control-lambda s))
; TODO: below
(define get-external-ip
  (c "GetExternalIPAddress" '("NewExternalIPAddress")))
(define add-port-mapping
  (c "AddPortMapping" '()
     "NewRemoteHost" "NewExternalPort" "NewProtocol"
     "NewInternalPort" "NewInternalClient" "NewEnabled"
     "NewPortMappingDescription" "NewLeaseDuration"))

And then use (get-external-ip) to get the external ip, or use (add-port-mapping ...) with the parameters.

License

MIT, see LICENSE.txt

Jump to Line
Something went wrong with that request. Please try again.