Skip to content

Commit

Permalink
Fix Socks5DatagramSocket.send
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Jan 30, 2019
1 parent 7cd6b3e commit 932a1d0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Socks5DatagramSocket(proxy: Proxy) : DatagramSocket() {
override fun send(dp: DatagramPacket) {
val data = ByteBuffer.allocate(6 + dp.address.address.size + dp.length).apply {
// header
put(Socks5Message.SOCKS_VERSION.toByte())
putShort(0)
putShort(0) // reserved
put(0) // fragment number
put(when (dp.address) {
is Inet4Address -> Socks5Message.SOCKS_ATYP_IPV4
is Inet6Address -> Socks5Message.SOCKS_ATYP_IPV6
Expand Down

0 comments on commit 932a1d0

Please sign in to comment.