WhiteCrow 0 Posted September 20, 2005 I have a http server running on 192.168.1.100 on port 18080 how can i check remotly from within the lan, if the website is still up ? The page i want to check is account.htm I wanted to use Wouters _InetGetSource, but that function doenst support port numbers. And the _InetGetSource that comes with the latest beta doesnt even support, non exsistant pages Any help would be apreciated Share this post Link to post Share on other sites
MSLx Fanboy 0 Posted September 20, 2005 (edited) Just send a Get request via the TCP* functions Dim $header $header = "GET / HTTP/1.1" & @CRLF & _ "Host: www.w3c.org" & @CRLF & _ "Connection: close" & @CRLF & _ "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*" & @CRLF & _ "Accept-Language: en-us" & @CRLF & _ "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Web-Sniffer/1.0.22" & @CRLF & _ "Referer: http://web-sniffer.net/" & @CRLF & @CRLF TCPStartup() $socket = TCPConnect('192.168.1.100',18080) TCPSend($socket, $header) $return = TCPRecv($socket, 5000) MsgBox(0, 'test', $return) No guarantees, off the top of my head Edit2: Used the web-sniffer.net services for this (as seen in Referer...) Edited September 20, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Share this post Link to post Share on other sites
WhiteCrow 0 Posted September 21, 2005 You are right Must have been blind while looking at the Autoit-helpfile.. that i missed it. The code is straightforward. $server_IP = "192.168.1.100" $server_http_port = "18080" TCPStartUp() $socket = TCPConnect( $server_IP, $server_http_port ) If $socket = -1 Then MsgBox(0, "", "Error") else MsgBox(0, "", $socket) endif Share this post Link to post Share on other sites
MSLx Fanboy 0 Posted September 21, 2005 (edited) You can do that, but you can't guarantee that there is an HTTP server at the other end...You can also use a com object (winhttprequest i believe) Edited September 21, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Share this post Link to post Share on other sites