This should do the trick:
URL url = new URL(yourUrlHere);
Proxy proxy = new Proxy(Proxy.Type.DIRECT,
new InetSocketAddress(
InetAddress.getByAddress(
new byte[]{your, ip, interface, here}), yourTcpPortHere));
URLConnection conn = url.openConnection(proxy);
And you are done.
Dont forget to handle exceptions nicely and off course change the values to suit your scenario.
Ah and I omitted the import statements
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…