Old 7th April 2016, 19:39   #1
Junior Member
Join Date: Jun 2006
Posts: 5
Check remote port


I'm looking for a solution to check whether the host on which the installer is executed can connect to a remote location (and specific port). For example, can the host connect to ip x.x.x.x on port y? I have a service running on a particular port on a remote host that returns the string 'OK' when connecting to it and I want to verify (during installation) whether this service can be reached.

I've found the ports.nsh script ... but this can only be used to check local ports. Is there any alternative that supports checking remote connections?

Any feedback is appreciated.

n.s. is offline   Reply With Quote
Old 7th April 2016, 20:12   #2
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,275
If it always returns OK no matter what the input is then you can maybe pretend that it is a HTTP server:

PHP Code:
Pop $0
DetailPrint Status
=$OK or error from inetc
DetailPrint Response
=$Data from server 

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 8th April 2016, 11:09   #3
Junior Member
Join Date: Jun 2006
Posts: 5

Works like a charm.

n.s. is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump