Source and Destination Ports

Asked by Kyle Brost

Hello,

Is there a way to get the IP target and source ports for the session?

Thanks,

Kyle Brost
----

Question information

Language:
English Edit question
Status:
Solved
For:
eCAP Edit question
Assignee:
No assignee Edit question
Solved by:
Kyle Brost
Solved:
Last query:
Last reply:
Revision history for this message
Alex Rousskov (rousskov) said :
#1

A host application may provide source and destination details of the underlying transport connection to adapters via HTTP headers and/or transaction meta information. For example, Squid can set HTTP X-Client-IP request header and/or supply metaClientIp eCAP transaction option.

Request destination port information can usually be inferred from HTTP Request-URI or Host header (subject to protocol scheme defaults).

Revision history for this message
Kyle Brost (kyle-brost) said :
#2

I do not see how you can identify the source port information. The X-Client-IP header only has xxx.xxx.xxx.xxx and no port information. I can easily infer that the destination is 80, 443, or what ever. The issue is figuring out the source port.

Any other idea?

Revision history for this message
Alex Rousskov (rousskov) said :
#3

I am not aware of any standard-ish way to relay client source port information, but you can ask the developers of your host application to supply X-Client-Port or similar meta information. The API to pass such info from the host application to adapter is already there.

Revision history for this message
Kyle Brost (kyle-brost) said :
#4

I made a change to the squid source to enable the port forwarding. Thanks!

Revision history for this message
Jatin (jbhasin83) said :
#5

Hi Kyle,

Can you please suggest me that what changes did you make to squid to enable port forwarding to eCap.