I need to connect my aim transport through a SOCKS server without forcing all TCP connections (such as JDBC) to get proxied.
As a quick hack, I made the following changes to the gateway:
- Update AbstractFlapConnection.java:
public AbstractFlapConnection(ConnDescriptor cd, OSCARSession mainSession) {
super(cd); // Hand off to ClientFlapConn
super.setSocketFactory(new GatewaySocketFactory()); //added this line
initBaseFlapConnection();
oscarSessionRef = new WeakReference<OSCARSession>(mainSession);
}
- Create GatewaySocketFactory.java (see attached)
This is proof of concept code I hacked together, not production quality.
Has anyone else run into this issue? Should this be handled some other way?
GatewaySocketFactory.java (2348 Bytes)