Skip to content

rvk01/upnp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

upnp

UPnP implementation for FPC

Sample

UPnP := TUPnP.Create('0.0.0.0');

if UPnP.IsUPnPAvailable then
begin
  Writeln('UPnP device is available at ' + UPnP.ControlURL);


// Set a port mapping
if UPnP.SetPortMapping(UPnP.InternalIP, 8081, 8000, 'TCP') then // use own computer IP

// Delete a port mapping
if UPnP.DeletePortMapping(8000) then

Example output

UPnP is available.

Internal IP: 192.168.2.11
External IP: x.x.x.x
Status: Connected
Last error: ERROR_NONE
Uptime router: 23 days, 4 hours 41 minutes and 24 seoconds

SetPortMapping OK
Portmappings:
0 UDP 3332->192.168.2.21:3332 libminiupnpc 0 s
1 UDP 3344->192.168.2.21:4444 test 0 s
2 TCP 8000->192.168.2.11:8081  0 s

Check port. Press Enter to delete and terminate


DeletePortMapping OK

Portmappings:
0 UDP 3332->192.168.2.21:3332 libminiupnpc 0 s
1 UDP 3344->192.168.2.21:4444 test 0 s

We are done, press enter

About

UPnP implementation for FPC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages