1 Star 0 Fork 0

Eugene/toralize

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
toralize.h 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <arpa/inet.h>
#define PROXY "127.0.0.1"
#define PROXY_PORT 9050
#define USERNAME "toraliz"// "toraliz\0"
#define reqsize sizeof(struct proxy_request)
#define ressize sizeof(struct proxy_response)
/*
system call or util function we need to use:
- socket()
- connect()
- close()
- htons()
- inet_addr()
*/
//--------------------------------------------------------
// sock4 rfc: https://www.openssh.com/txt/socks4.protocol
//--------------------------------------------------------
typedef unsigned char int8;
typedef unsigned short int int16;
typedef unsigned int int32;
struct proxy_request {
int8 vn;
int8 cd;
int16 dstport;
int32 dstip;
unsigned char userid[8];
};
typedef struct proxy_request Req;
struct proxy_response {
int8 vn;
int8 cd;
int16 _;// ignored
int32 __;// ignored
};
typedef struct proxy_response Res;
Req *request(const char *, const int);
int main(int, char **);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/egu0/toralize.git
git@gitee.com:egu0/toralize.git
egu0
toralize
toralize
master

搜索帮助