mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-22 23:59:41 +08:00
Connect back proxy functionality added
-r and -R options added to support connect back functionality between two instances of proxy
This commit is contained in:
1 parent
6529b9cea1
commit
a2b5af6dab
5 files changed
+182
-67
No files matched your search
@@ -216,6 +216,24 @@ int ceparseargs(const char *str){
|
||||
|
||||
#endif
|
||||
|
||||
void parsehost(int family, char *host, struct sockaddr *sa){
|
||||
char *sp=NULL,*se=NULL;
|
||||
unsigned short port;
|
||||
|
||||
if(*host == '[') se=strchr(host, ']');
|
||||
if ( (sp = strchr(se?se:host, ':')) ) *sp = 0;
|
||||
if(se){
|
||||
*se = 0;
|
||||
}
|
||||
if(sp){
|
||||
port = atoi(sp+1);
|
||||
}
|
||||
getip46(family, host + (se!=0), (struct sockaddr *)sa);
|
||||
if(se) *se = ']';
|
||||
if(sp) *sp = ':';
|
||||
*SAPORT(sa) = htons(port);
|
||||
}
|
||||
|
||||
int parsehostname(char *hostname, struct clientparam *param, unsigned short port){
|
||||
char *sp=NULL,*se=NULL;
|
||||
|
||||
|
||||
Reference in new issue
Block a user