i wanna connect with Socks4 Proxy
:My code: 'FA0 - 4000
wsD2GS.Senddata Chr(&H4) & Chr(&H1) & Chr(&HFA) & Chr(&H0) & Host & "zero" & Chr(&H0)
:Recv:
00 5B FA 00 D3 E9 10 84
My code doesnt work.. :(
Please help me
Not sure how different it would be to implement Socks4 as opposed to Socks5, but check this out:
http://botdev.valhallalegends.com/documents/vbsocks5.html
Quote from: zeroirc on August 30, 2008, 10:37 PM
i wanna connect with Socks4 Proxy
:My code: 'FA0 - 4000
wsD2GS.Senddata Chr(&H4) & Chr(&H1) & Chr(&HFA) & Chr(&H0) & Host & "zero" & Chr(&H0)
:Recv:
00 5B FA 00 D3 E9 10 84
My code doesnt work.. :(
Please help me
Look's abit iffy.
1st, the port 4000 should be 0xa00f?
2nd, the host variable, i'm assuming this is a string, like "1.2.3.4"?
3rd, erm, "zero"?
try somthing like this:
Private Declare Function send Lib "ws2_32" (ByVal S As Long, ByRef Buf As Any, _
ByVal buflen As Long, ByVal Flags As Long) As Long
Private Declare Function inet_addr Lib "ws2_32" (ByVal InAddress As String) As Long
Private Declare Function htons Lib "ws2_32" (ByVal hostshort As Integer) As Integer
Private Declare Sub RtlMoveMemory Lib "kernel32" (ByRef destination As Any, _
ByRef Source As Any, ByVal numbytes As Long)
Dim bData(8) As Byte
bData(0) = &H4
bData(1) = &H1
Call RtlMoveMemory(bData(2), htons(4000), 2)
Call RtlMoveMemory(bData(4), inet_addr("1.2.3.4"), 4)
bData(8) = &H0
Call send(wsD2GS.SocketHandle, bData(0), 9, 0)
That should then send somthing like 04 01 0f a0 01 02 03 04 00
Then, if you get a 0x5B responce still it mean's you're request was rejected for what ever reassion. (assuming the port and IP were correct)
hope this helps
I wrote a tutorial on this like 4 years ago. I'll post it when I get back home.
Thank you Yegg, PiaNKA! (Thank you very much for your kindness. Ringo.)
it does work! :)
Quote from: zeroirc on September 07, 2008, 09:30 PM
Thank you Yegg, PiaNKA! (Thank you very much for your kindness. Ringo.)
it does work! :)
You should post your solution (even if it happens to look terrible) so that maybe future attempts by others can also be helped.
Quote from: Yegg on September 07, 2008, 11:19 PM
You should post your solution (even if it happens to look terrible) so that maybe future attempts by others can also be helped.
QFT.
I'd actually like to see this.
I don't get why anybody who knows how to read the official documentation (http://www.ufasoft.com/doc/socks4_protocol.htm) would need an example along with it?
Seems pretty straightforward.
Quote from: brew on September 08, 2008, 02:11 PM
I don't get why anybody who knows how to read the official documentation (http://www.ufasoft.com/doc/socks4_protocol.htm) would need an example along with it?
Seems pretty straightforward.
Didn't even know about that. Then again, I wasn't looking, the thread just caught my attention.