Sign in to follow this  
Followers 0
Das Ami

Testing a local socket for remote internet connectivity

1 post in this topic

Hi Everyone

I have a script to automate a plink login into an SSH server so that I can browse anonymously. Plink creates a local socket on the defined port where I can connect with my browser like so:

[browser/Script] <---> [Local plink socket] <---> [Remote SSH Server] <---> [Websites requested by browser/script]

Now; the problem is that there seems to be no way to test that local socket for internet connectivity within AutoIt.

I thought about maybe sending a GET request to google.com and then evaluating the response.

Any other ideas? Here's my script:

If ProcessExists("plink.exe") Then ProcessClose("plink.exe")
If Not FileExists(@ScriptDir&"\plink.exe") Then
    MsgBox(0, "", "Couldn't find plink.exe")
    Exit
EndIf
ShellExecute(@ScriptDir&"\plink.exe", "-ssh -2 -D 8686 -batch -pw PASSWORD USER@SERVER.net", "", "", @SW_HIDE)
Sleep(10000)
TCPStartup()
$con=TCPConnect("127.0.0.1", 8686)
If $con=0 or -1 Then MsgBox(0, "", "Couldn't connect to local socket.")
;~ Test for remote connectivity here.
TCPCloseSocket($con)
TCPShutdown()

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0