Sign in to follow this  
Followers 0
phew

TCP + HTTP Request + Proxy/Sock

8 posts in this topic

hi guys!

TCPStartup()
$start = 1
$socket = TCPConnect(TCPNameToIP('www.autoitscript.com'), 80)
$cmd  = 'GET / HTTP/1.1' & @CRLF
$cmd &= 'Host: www.autoitscript.com' & @CRLF
$cmd &= 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9' & @CRLF
$cmd &= 'Connection: close' & @CRLF
$cmd &= '' & @CRLF
TCPSend($socket, $cmd)

While (1)
    If ($start = 1) Then
        $srcv = TCPRecv($socket, 512)
        If ($srcv <> "") Then
            MsgBox(0, "", $srcv)
        EndIf
    EndIf
WEnd

this is my little script. but how do i make it work with proxy/sock? i read alot about sock5/4 and proxy protocol but i have no clue how to implement a sock/proxy into the script, so that the *.au3 is using a proxy/sock when connecting to the host.

help pls!

king regards

Share this post


Link to post
Share on other sites

another question: is this possible at all? is it possible to force the socket, which is already connected to the sock4/5 or proxy, to connect to a website without losing the connection to the sock4/5 or proxy?

greetings

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

thanks but i already figured out how to use SOCK - i just made a simple mistake in the sock's request synthax!

http://www.faqs.org/rfcs/rfc1928.html

is really helpful to get started with socks, if someone is interested, too <_<

regards,

phew

Edited by phew

Share this post


Link to post
Share on other sites

Alternatively, You could use winhttprequest oo


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@phew

If you figured it out why don't you post it.

We all can still a lot. ;)

Regards

ptrex

81.x.x.x = sock5 ip

64.111.104.70 = autoitscript.com

(...)
$socket = TCPConnect('81.x.x.x', 5728)
$cmd  = 'CMD CONNECT 64.111.104.70:80 GET / HTTP/1.1' & @CRLF
(...)

CMD CONNECT is explained in the sock5 reference i posted above :P

hope this helps others!

Edited by phew

Share this post


Link to post
Share on other sites

can anyone confirm this works for them..?

I tried it, but it don't seem to work for me..

what might I be overlooking..?

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