- /* if not using a SOCKS proxy server, make the connection directly */
- if (strlen(socks4) == 0) {
- serv_sock = connectsock(cithost, citport, "tcp", 504);
- if (hostbuf != NULL) strcpy(hostbuf, cithost);
- if (portbuf != NULL) strcpy(portbuf, citport);
- return;
- }
- /* if using SOCKS, connect first to the proxy... */
- serv_sock = connectsock(socks4, "1080", "tcp", 1080);
- printf("Connected to SOCKS proxy at %s.\n", socks4);
- printf("Attaching to server...\r");
- fflush(stdout);
-
- snprintf(buf, sizeof buf, "%c%c",
- 4, /* version 4 */
- 1); /* method = connect */
- serv_write(buf, 2);
-
- numericize(buf, cithost, citport, "tcp", 504);
- serv_write(buf, 6); /* port and address */
-
- p = (struct passwd *) getpwuid(getuid());
- serv_write(p->pw_name, strlen(p->pw_name) + 1);
- /* user name */
-
- serv_read(buf, 8); /* get response */
-
- if (buf[1] != 90) {
- printf("SOCKS server denied this proxy request.\n");
- logoff(3);
- }
+ serv_sock = connectsock(cithost, citport, "tcp", 504);
+ if (hostbuf != NULL) strcpy(hostbuf, cithost);
+ if (portbuf != NULL) strcpy(portbuf, citport);
+ return;