Know what port a URL was executed on?

Has anyone every written a Flow Service that would be executed via a URL and wanted to know what port the execution was made on for security reasons. I would like to restrict execution based on the port that the URL is executed on, is there a way in the flow service to know this without building it as part of the input parameters.

You can configure the port listener itself to restrict which services are made available via that port. Review the IS Admin UI and docs.

Rob is right - setting port listener permissions - ie. deny by default, services permitted on that port - is the best way to secure this service.

Alternatively, check out the pub.flow:getTransportInfo service in the WmPublic package. The ‘transport/http/ipInfo/localPort’ output from that service should be what you need.