Skip to content

Instantly share code, notes, and snippets.

@lgawin
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgawin/10827219 to your computer and use it in GitHub Desktop.
Save lgawin/10827219 to your computer and use it in GitHub Desktop.
public static void main(String... args) throws IOException {
String host = args[0];
int port = Integer.parseInt(args[1]);
String botName = args[2];
String botKey = args[3];
System.out.println("Connecting to " + host + ":" + port + " as "
+ botName + "/" + botKey);
//final Socket socket = new Socket(host, port);
// -->
final Socket socket = new Socket(new Proxy(Proxy.Type.HTTP), new InetSocketAddress(PROXY_IP, PROXY_PORT));
socket.connect(new InetSocketAddress(host, port))
// <--
final PrintWriter writer = new PrintWriter(new OutputStreamWriter(
socket.getOutputStream(), "utf-8"));
final BufferedReader reader = new BufferedReader(new InputStreamReader(
socket.getInputStream(), "utf-8"));
new Main(reader, writer, new Join(botName, botKey));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment