c中的socks代理身份验证
socks proxy authentication in c
我有一个功能是设计一个socks握手包;但我找不到有关如何填写授权字段的任何信息。认证包格式如何?
void socks_auth(int sd, char *buffer) {
char *ptrBuff;
ptrBuff = buffer;
*(ptrBuff++) = SOCKS_V;
*(ptrBuff++) = 2;
*(ptrBuff++) = 0x00;
*(ptrBuff++) = 0x02;
send(sd, ptrBuff, ptrBuff - buffer, 0);
recv(sd, buffer, 2, 0);
if (buffer[1] == 0xFF) write(STDOUT_FILENO, "not supported\n", 14);
if (buffer[1] == 0x02) {
};
}
我有一个功能是设计一个socks握手包;但我找不到有关如何填写授权字段的任何信息。认证包格式如何?
void socks_auth(int sd, char *buffer) {
char *ptrBuff;
ptrBuff = buffer;
*(ptrBuff++) = SOCKS_V;
*(ptrBuff++) = 2;
*(ptrBuff++) = 0x00;
*(ptrBuff++) = 0x02;
send(sd, ptrBuff, ptrBuff - buffer, 0);
recv(sd, buffer, 2, 0);
if (buffer[1] == 0xFF) write(STDOUT_FILENO, "not supported\n", 14);
if (buffer[1] == 0x02) {
};
}