Mercurial > stress-tester
changeset 1154:b03609639a1e
HttpTrafficDumperFilter - real client and server addresses
author | Devel 2 |
---|---|
date | Fri, 12 Jun 2020 14:50:59 +0200 |
parents | 39588e98056b |
children | 3eefcb0f98cf |
files | stress-tester/src/main/java/com/passus/st/client/http/filter/HttpTrafficDumperFilter.java |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpTrafficDumperFilter.java Fri Jun 12 13:47:50 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpTrafficDumperFilter.java Fri Jun 12 14:50:59 2020 +0200 @@ -7,6 +7,7 @@ import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; import com.passus.data.ByteString; +import com.passus.net.SocketAddress; import com.passus.net.http.HttpHeaders; import com.passus.net.http.HttpRequest; import com.passus.net.http.HttpResponse; @@ -14,7 +15,7 @@ import com.passus.st.ParametersBag; import com.passus.st.client.FlowContext; import com.passus.st.client.http.HttpFlowContext; -import com.passus.st.emitter.SessionInfo; +import com.passus.st.emitter.ChannelContext; import com.passus.st.filter.FlowFilter; import com.passus.st.plugin.PluginConstants; import com.passus.st.utils.CsvHelper; @@ -149,11 +150,14 @@ createWriter(fileName); } - SessionInfo sessionInfo = context.sessionInfo(); - writeString(sessionInfo.getSrcIp().toString()); - writeInt(sessionInfo.getSrcPort()); - writeString(sessionInfo.getDstIp().toString()); - writeInt(sessionInfo.getDstPort()); + ChannelContext channelContext = context.channelContext(); + + SocketAddress localAddress = channelContext.getLocalAddress(); + SocketAddress remoteAddress = channelContext.getRemoteAddress(); + writeString(localAddress.getIp().toString()); + writeInt(localAddress.getPort()); + writeString(remoteAddress.getIp().toString()); + writeInt(remoteAddress.getPort()); writeString(req.getId()); writeString(req.getMethod().toString());