proxy: simple add socks5 and https proxy support
This commit is contained in:
22
src/util.c
22
src/util.c
@@ -1,6 +1,6 @@
|
||||
/*************************************************************************
|
||||
*
|
||||
* Copyright (C) 2018-2020 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
* Copyright (C) 2018-2023 Ruilin Peng (Nick) <pymumu@gmail.com>.
|
||||
*
|
||||
* smartdns is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -684,6 +684,24 @@ errout:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int SSL_base64_encode(const void *in, int in_len, char *out)
|
||||
{
|
||||
int outlen = 0;
|
||||
|
||||
if (in_len == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
outlen = EVP_EncodeBlock((unsigned char *)out, in, in_len);
|
||||
if (outlen < 0) {
|
||||
goto errout;
|
||||
}
|
||||
|
||||
return outlen;
|
||||
errout:
|
||||
return -1;
|
||||
}
|
||||
|
||||
int create_pid_file(const char *pid_file)
|
||||
{
|
||||
int fd = 0;
|
||||
@@ -1469,7 +1487,7 @@ int dns_packet_debug(const char *packet_file)
|
||||
char buff[DNS_PACKSIZE];
|
||||
|
||||
tlog_set_maxlog_count(0);
|
||||
tlog_setlogscreen(1);;
|
||||
tlog_setlogscreen(1);
|
||||
tlog_setlevel(TLOG_DEBUG);
|
||||
|
||||
info = _dns_read_packet_file(packet_file);
|
||||
|
||||
Reference in New Issue
Block a user