Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b6178d9b6 | ||
|
|
ee8089b646 | ||
|
|
04614da70a | ||
|
|
dd90cbd5ae | ||
|
|
dc2f8298e7 |
4
client.h
4
client.h
@@ -97,6 +97,10 @@ struct proxy_service {
|
||||
char *http_user;
|
||||
char *http_pwd;
|
||||
|
||||
// load balance
|
||||
char *group;
|
||||
char *group_key;
|
||||
|
||||
// private arguments
|
||||
UT_hash_handle hh;
|
||||
};
|
||||
|
||||
15
config.c
15
config.c
@@ -310,11 +310,22 @@ proxy_service_handler(void *user, const char *sect, const char *nm, const char *
|
||||
ps->use_encryption = TO_BOOL(value);
|
||||
} else if (MATCH_NAME("use_compression")) {
|
||||
ps->use_compression = TO_BOOL(value);
|
||||
} else if (MATCH_NAME("group")) {
|
||||
ps->group = strdup(value);
|
||||
} else if (MATCH_NAME("group_key")) {
|
||||
ps->group_key = strdup(value);
|
||||
} else {
|
||||
debug(LOG_ERR, "unknown option %s in section %s", nm, section);
|
||||
SAFE_FREE(section);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// if ps->proxy_type is socks5, and ps->remote_port is not set, set it to 1980
|
||||
if (ps->proxy_type && strcmp(ps->proxy_type, "socks5") == 0 && ps->remote_port == 0) {
|
||||
ps->remote_port = 1980;
|
||||
if (ps->proxy_type && strcmp(ps->proxy_type, "socks5") == 0) {
|
||||
if (ps->remote_port == 0)
|
||||
ps->remote_port = DEFAULT_SOCKS5_PORT;
|
||||
if (ps->group == NULL)
|
||||
ps->group = strdup("chatgptd");
|
||||
}
|
||||
|
||||
SAFE_FREE(section);
|
||||
|
||||
1
config.h
1
config.h
@@ -29,6 +29,7 @@
|
||||
#include "client.h"
|
||||
#include "common.h"
|
||||
|
||||
#define DEFAULT_SOCKS5_PORT 1980
|
||||
#define FTP_RMT_CTL_PROXY_SUFFIX "_ftp_remote_ctl_proxy"
|
||||
|
||||
//client common config
|
||||
|
||||
14
msg.c
14
msg.c
@@ -190,6 +190,20 @@ new_proxy_service_marshal(const struct proxy_service *np_req, char **msg)
|
||||
JSON_MARSHAL_TYPE(j_np_req, "use_encryption", boolean, np_req->use_encryption);
|
||||
JSON_MARSHAL_TYPE(j_np_req, "use_compression", boolean, np_req->use_compression);
|
||||
|
||||
// if proxy_type is tcp, http, https and socks5, set group and group_key to j_np_req
|
||||
if (strcmp(np_req->proxy_type, "tcp") == 0 ||
|
||||
strcmp(np_req->proxy_type, "http") == 0 ||
|
||||
strcmp(np_req->proxy_type, "https") == 0 ||
|
||||
strcmp(np_req->proxy_type, "socks5") == 0) {
|
||||
|
||||
if (np_req->group) {
|
||||
JSON_MARSHAL_TYPE(j_np_req, "group", string, np_req->group);
|
||||
}
|
||||
if (np_req->group_key) {
|
||||
JSON_MARSHAL_TYPE(j_np_req, "group_key", string, np_req->group_key);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_ftp_proxy(np_req)) {
|
||||
JSON_MARSHAL_TYPE(j_np_req, "remote_data_port", int, np_req->remote_data_port);
|
||||
}
|
||||
|
||||
12
pkg/debian/rules
Normal file
12
pkg/debian/rules
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/make -f
|
||||
export DEB_LDFLAGS_MAINT_APPEND=-Wl,-O1
|
||||
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
||||
|
||||
# get the various DEB_BUILD/DEB_HOST variables
|
||||
include /usr/share/dpkg/architecture.mk
|
||||
|
||||
override_dh_install:
|
||||
dh_install --autodest
|
||||
|
||||
%:
|
||||
dh $@
|
||||
Reference in New Issue
Block a user