Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customizing the transport protocol used for Via headers #1026

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

radioprotector
Copy link

This allows for transport protocols that are not based solely on Transport.server's URL scheme.

This provides a path for eliminating the deprecated UserAgentOptions.hackViaTcp configuration option, as the transport options can now have { headerProtocol: "TCP" } in its place.

This change is also useful when working with SIP endpoints that are behind a load balancer with SSL termination at the balancer. In that case, the transport protocol between the browser and the load balancer would use the SIPS/WSS/TLS protocol, but I believe the transport protocol indicated in the Via header would need to be SIP/WS/TCP when it reaches the SIP endpoints.

Potential Alternative

Instead of impacting Transport.protocol, I considered adding an alternate Transport.headerProtocol property that would be referenced in setViaHeader calls.

However, the core Transport.protocol property states that it is formatted "as defined for the Via header sent-protocol transport", and Transport.protocol is currently only referenced for the purposes of setViaHeader calls, so I felt this would be redundant.

thefinn93 added a commit to AccelerateNetworks/fusionpbx-webtexting that referenced this pull request May 5, 2023
@tal952
Copy link

tal952 commented Jul 7, 2023

As an hack, you can do: simpleUser.sessionManager.userAgent._transport._protocol = "WS";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants