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

Hi,

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.


Thanks
n.s. is offline   Reply With Quote
Old 7th April 2016, 20:12   #2
Anders
Moderator
 
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:
inetc::head /SILENT /WEAKSECURITY /NOPROXY /TOSTACK http://216.58.209.110:80/gag "" /END
Pop $0
Pop 
$1
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
n.s.
Junior Member
 
Join Date: Jun 2006
Posts: 5
Hi,

Works like a charm.


Thanks!
n.s. is offline   Reply With Quote
Reply
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