function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
osf_teamosf_team 

Streaming API with Proxy environment

Hi ,

Streaming API has a known issue which returns "Unknown client" when used through a proxy. Refer to link below.

https://success.salesforce.com/issues_view?id=a1p30000000T0F0AAK

Below is the workaround suggested for the above issue:

Workaround
For now, the main workaround involves by-passing the proxy as when requests are sent through proxies, they hard code the host name in the POST request: 

POST https://mycompany.cs11.my.salesforce.com/cometd/28.0/connect HTTP/1.1 

instead of 

POST /cometd/28.0/connect HTTP/1.1 

which is not handled properly by the code that sets up a cookie used by the Streaming API, thus breaking the connection flow.


Has anybody tried the above workaround? Does it work? If yes, Can we get a sample snippet for the same?

PS :  We are using the code reference provided at below link for writing our client
http://www.salesforce.com/us/developer/docs/api_streaming/Content/code_sample_java_add_source.htm

Thanks,
Shalindra