Jump to content
Sign in to follow this  
Das Ami

Testing a local socket for remote internet connectivity

Recommended Posts

Das Ami

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")
ShellExecute(@ScriptDir&"\plink.exe", "-ssh -2 -D 8686 -batch -pw PASSWORD USER@SERVER.net", "", "", @SW_HIDE)
$con=TCPConnect("", 8686)
If $con=0 or -1 Then MsgBox(0, "", "Couldn't connect to local socket.")
;~ Test for remote connectivity here.

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.