GithubHelp home page GithubHelp logo

Comments (5)

grayscott avatar grayscott commented on August 11, 2024

udp response destaddress and destport should be connect dest address and port
a, addr, port, err := ParseAddress(ue.RemoteConn.RemoteAddr().String())
if err != nil {
log.Println(err)
break
}
d1 := NewDatagram(a, addr, port, b[0:n])
if _, err := s.UDPConn.WriteToUDP(d1.Bytes(), ue.ClientAddr); err != nil {
break
}

from socks5.

txthinking avatar txthinking commented on August 11, 2024

The RFC doesn't describe this addr when socks5 reply to udp client.

Based RFC1928, we can guess the intention. When a socks5 client want to send UDP, then:

  1. TCP: client prepares a UDP address A (that the client expects
    to use to send UDP datagrams)
  2. TCP: server sends a address B(tell client should send data to)
  3. UDP: client uses A send data to B
  4. UDP: server sends data to remote and get data from remote
  5. UDP: server sends data to client, and write a address in datagram, so I think this address should be A, so client can pair this data cause by which send

from socks5.

0990 avatar 0990 commented on August 11, 2024

RFC1928 say " when a UDP relay server receives a replay datagram from a remote host,it must encapsulate that datagram using the above UDP request header",so I guess grayscott is right
1,TCP: client prepares a UDP address A (that the client expects
to use to send UDP datagrams)
2,TCP: server sends a address B(tell client should send data to)
3,UDP: client uses A send data to B and write a address C in datagram,C means remote target
4,UDP: server sends data to remote C and get data from remote C
5,UDP: server sends data to client, and write a address in datagram, so I think this address should be C, so client can pair this data cause by which send

from socks5.

0990 avatar 0990 commented on August 11, 2024

I test ss5(http://ss5.sourceforge.net/ ),found the address udp datagram returned to client is C

from socks5.

txthinking avatar txthinking commented on August 11, 2024

@0990 Thank you.

from socks5.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.