support 'raw' proxy type

pull/348/head
aviau 2020-10-27 15:04:26 -04:00
parent 486f8200ad
commit c1c5cfa578
No known key found for this signature in database
GPG Key ID: 8F2B113C6535C5A7
4 changed files with 10 additions and 2 deletions

View File

@ -222,6 +222,10 @@ static int tunnel_to(int sock, ip_type ip, unsigned short port, proxy_type pt, c
int v6 = ip.is_v6;
switch (pt) {
case RAW_TYPE: {
return SUCCESS;
}
break;
case HTTP_TYPE:{
if(!dns_len) {
if(!inet_ntop(v6?AF_INET6:AF_INET,ip.addr.v6,ip_buf,sizeof ip_buf)) {

View File

@ -41,7 +41,8 @@ typedef enum {
typedef enum {
HTTP_TYPE,
SOCKS4_TYPE,
SOCKS5_TYPE
SOCKS5_TYPE,
RAW_TYPE
} proxy_type;
typedef enum {

View File

@ -354,6 +354,8 @@ inv_host:
if(!strcmp(type, "http")) {
pd[count].pt = HTTP_TYPE;
} else if(!strcmp(type, "raw")) {
pd[count].pt = RAW_TYPE;
} else if(!strcmp(type, "socks4")) {
pd[count].pt = SOCKS4_TYPE;
} else if(!strcmp(type, "socks5")) {

View File

@ -145,7 +145,8 @@ tcp_connect_time_out 8000
# http 192.168.39.93 8080
#
#
# proxy types: http, socks4, socks5
# proxy types: http, socks4, socks5, raw
# * raw: The traffic is simply forwarded to the proxy without modification.
# ( auth types supported: "basic"-http "user/pass"-socks )
#
[ProxyList]