- fwd->gateway_host = strdup(socks_proxy);
-
- if (NULL != (socks_proxy = strchr(fwd->gateway_host, ':')))
- {
- *socks_proxy++ = '\0';
- fwd->gateway_port = (int)strtol(socks_proxy, NULL, 0);
- }
-
- if (fwd->gateway_port <= 0)
- {
- fwd->gateway_port = 1080;
- }
+ fwd->gateway_port = 1080;
+ parse_forwarder_address(socks_proxy,
+ &fwd->gateway_host, &fwd->gateway_port);