org.littleshoot.proxy.FlowContext Maven / Gradle / Ivy
package org.littleshoot.proxy;
import java.net.InetSocketAddress;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLSession;
import org.littleshoot.proxy.impl.ClientToProxyConnection;
/**
*
* Encapsulates contextual information for flow information that's being
* reported to a {@link ActivityTracker}.
*
*/
public class FlowContext {
private final InetSocketAddress clientAddress;
private final SSLSession clientSslSession;
public FlowContext(ClientToProxyConnection clientConnection) {
super();
this.clientAddress = clientConnection.getClientAddress();
SSLEngine sslEngine = clientConnection.getSslEngine();
this.clientSslSession = sslEngine != null ? sslEngine.getSession()
: null;
}
/**
* The address of the client.
*
* @return
*/
public InetSocketAddress getClientAddress() {
return clientAddress;
}
/**
* If using SSL, this returns the {@link SSLSession} on the client
* connection.
*
* @return
*/
public SSLSession getClientSslSession() {
return clientSslSession;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy