问题
I have a Http server implemented using indy TidHTTPServer on Delphi XE2. This product is mostly used for intranet, however sometimes it is needed to be accessed from internet also. The target customers are small companies, and for this PnP capabilities is a must.
For internal use this server uses the current IP from the server and try to assign the port 8888.
I want to discover a wandevice on the network that can let me ask for port routing. I am not sure port routing is the best solution either, I am not familiar with the possibilities. However I prefer the most widely available possibilities, since I believe not all routers have full options.
For these case I am considering common routers, like linksys, tplink, etc, that comes with DSL installations, widelly used on small companies.
If there is a link for a component or source code that already implement this even better.
回答1:
UPnP Delphi components seem to be available
- http://www.whitebear.ch/upnp.htm (with source, freeware / donationware)
A description of UPnP basics and links to source examples are available here
- http://francois-piette.blogspot.de/2013/02/using-universal-plug-and-play-upnp-with.html
Related question about device discovery using Indy:
- Can I use IdUDPClient to send M-SEARCH request?
来源:https://stackoverflow.com/questions/15531441/how-to-implement-upnp-on-delphi-xe2