-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use TCP to communicate. Now most SOCKS use TCP instead of UDP. #21
Comments
Well, I was wrong... Actually we're all wrong, and your question @77193404 is also incorrect. The device traffic itself goes over TCP as normal, the DNS queries are what go over UDP! as mentioned here #18 (comment). var udp = require('dgram')
var server = udp.createSocket('udp6')
server.on('error', err => {
error('Error: ' + err)
server.close()
})
server.on('message', (msg, info) => {
log('UDP: ' + msg.toString('hex') + '\n(' + msg.toString() + ')')
})
server.bind(1080, () => {
log(`UDP server started on port 1080!`)
})
/** output:
UDP: 0000000108080808003517b8010000010000000000000377777706676f6f676c6503636f6d0000010001
(�����5�����www�google�com��)
**/ What I'm not sure about is how to handle these packets, I didn't find any resources that may help, hopefully the collaborators may provide me some info in order to parse the buffer and structuring the response to send it back to the client. |
I ended up using the actual UDP associate feature of SOCKS v5, someone made a pull request (#20) to add support for it. |
How to use TCP to communicate. Now most SOCKS use TCP instead of UDP.
The text was updated successfully, but these errors were encountered: