will mal UPnP support bei mir einbauen aber habe echt zero Doku gefunden.
Hat noch keiner was mit UPnP und Python gemacht
NAT Router mit UPnP
-
- User
- Beiträge: 424
- Registriert: Montag 28. Juli 2003, 16:19
- Wohnort: /dev/reality
Hier ist nun ein Beispiel was nötig ist für upnp:
Kann mir jemand sagen wie ich das am besten in Python machen kann?
Edit by Gerold: Code in Code-Tags eingeschlossen. Bitte beim nächsten Mal selber machen.
Kann mir jemand sagen wie ich das am besten in Python machen kann?
Code: Alles auswählen
POST /upnp/control/WANIPConn1 HTTP/1.1
HOST: 192.168.0.1:49000
SOAPACTION: "urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress"
CONTENT-TYPE: text/xml ; charset="utf-8"
Content-Length: 297
Code: Alles auswählen
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:GetExternalIPAddress xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" />
</s:Body>
</s:Envelope>HTTP/1.1 200 OK
DATE: Fri, 09 Jun 2006 02:27:09 GMT
SERVER: FRITZ!Box Fon WLAN 7170 UPnP/1.0 AVM FRITZ!Box Fon WLAN 7170 (UI) 29.04.06
CONNECTION: keep-alive
CONTENT-LENGTH: 339
CONTENT-TYPE: text/xml; charset="utf-8"
EXT:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetExternalIPAddressResponse xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
<NewExternalIPAddress>84.162.167.65</NewExternalIPAddress>
</u:GetExternalIPAddressResponse>
</s:Body> </s:Envelope>