diff --git a/CHANGELOG.md b/CHANGELOG.md index 452190a1d..ac6f4d498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. I will do my best to guarantee that this project adheres to [Semantic Versioning](http://semver.org/) after 1.0.0, but please do read change log before updating. +## 0.12.0 + +### Fixed +- Fix that the SOCKS adapter will send IP bytes in wrong order. + ## 0.11.0 ### Changed diff --git a/src/Socket/AdapterSocket/SOCKS5Adapter.swift b/src/Socket/AdapterSocket/SOCKS5Adapter.swift index 1344222c8..b5b80140f 100644 --- a/src/Socket/AdapterSocket/SOCKS5Adapter.swift +++ b/src/Socket/AdapterSocket/SOCKS5Adapter.swift @@ -59,10 +59,12 @@ public class SOCKS5Adapter: AdapterSocket { var response: [UInt8] if session.isIPv4() { response = [0x05, 0x01, 0x00, 0x01] - response += Utils.IP.IPv4ToBytes(session.host)! + let address = IPAddress(fromString: session.host)! + response += [UInt8](address.dataInNetworkOrder) } else if session.isIPv6() { response = [0x05, 0x01, 0x00, 0x04] - response += Utils.IP.IPv6ToBytes(session.host)! + let address = IPAddress(fromString: session.host)! + response += [UInt8](address.dataInNetworkOrder) } else { response = [0x05, 0x01, 0x00, 0x03] response.append(UInt8(session.host.utf8.count))