|
|
|
@ -246,7 +246,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket)
@@ -246,7 +246,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket)
|
|
|
|
|
string strSocks5("\5\1"); |
|
|
|
|
strSocks5 += '\000'; strSocks5 += '\003'; |
|
|
|
|
strSocks5 += static_cast<char>(std::min((int)strDest.size(), 255)); |
|
|
|
|
strSocks5 += strDest; |
|
|
|
|
strSocks5 += strDest; |
|
|
|
|
strSocks5 += static_cast<char>((port >> 8) & 0xFF); |
|
|
|
|
strSocks5 += static_cast<char>((port >> 0) & 0xFF); |
|
|
|
|
ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); |
|
|
|
@ -478,7 +478,7 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout)
@@ -478,7 +478,7 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout)
|
|
|
|
|
// first connect to proxy server
|
|
|
|
|
if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout)) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// do socks negotiation
|
|
|
|
|
switch (proxy.second) { |
|
|
|
|
case 4: |
|
|
|
@ -617,8 +617,8 @@ bool CNetAddr::IsIPv6() const
@@ -617,8 +617,8 @@ bool CNetAddr::IsIPv6() const
|
|
|
|
|
bool CNetAddr::IsRFC1918() const |
|
|
|
|
{ |
|
|
|
|
return IsIPv4() && ( |
|
|
|
|
GetByte(3) == 10 || |
|
|
|
|
(GetByte(3) == 192 && GetByte(2) == 168) || |
|
|
|
|
GetByte(3) == 10 || |
|
|
|
|
(GetByte(3) == 192 && GetByte(2) == 168) || |
|
|
|
|
(GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|