我正在尝试在SalesForce中使用Streaming API,它基本上是使用Comet/Long Polling技术实现的。在客户端中,我们使用带有Jettyhttp、bayeux api、cometd Java客户端的Java
如果我们在没有代理的情况下运行应用程序,一切都会完美运行。但如果客户端正在使用网络代理
A。它能够进行用户身份验证
B。长轮询握手成功
C。元/连接最初有402个错误(参考下面的日志),但最终成功
D从未从服务器端得到任何响应
有没有想过这里发生了什么,为什么代理会导致这种情况,即使上面A、B、C中的所有HTTP连接请求都成功了?
[12:23:50.504-HttpClient-21][CHANNEL:META_CONNECT]: {"id":"5","error":"402::Unknown client","successful":false,"advice":{"interval":500,"reconnect":"handshake"},"channel":"/meta/connect","clientId":"jj1ajqshe3lkkpp1rsiy5g30ppey"}
[12:23:50.504-HttpClient-21][CHANNEL:META_CONNECT] Error : 402::Unknown client
[12:23:51.760-HttpClient-23][CHANNEL:META_HANDSHAKE]: {"id":"6","minimumVersion":"1.0","supportedConnectionTypes":["long-polling"],"successful":true,"channel":"/meta/handshake","clientId":"ingkpdlgu6uy43m06ei30spqpl","version":"1.0"}
[12:23:53.170-HttpClient-19][CHANNEL:META_CONNECT]: {"id":"7","error":"402::Unknown client","successful":false,"advice":{"interval":500,"reconnect":"handshake"},"channel":"/meta/connect","clientId":"ingkpdlgu6uy43m06ei30spqpl"}
[12:23:53.170-HttpClient-19][CHANNEL:META_CONNECT] Error : 402::Unknown client
[12:23:54.408-HttpClient-22][CHANNEL:META_HANDSHAKE]: {"id":"8","minimumVersion":"1.0","supportedConnectionTypes":["long-polling"],"successful":true,"channel":"/meta/handshake","clientId":"fr1r22f6au89xpm1lbucrp26fs27","version":"1.0"}
[12:24:00.757-HttpClient-19][CHANNEL:META_CONNECT]: {"id":"9","successful":true,"advice":{"interval":0,"reconnect":"retry","timeout":110000},"channel":"/meta/connect","clientId":"fr1r22f6au89xpm1lbucrp26fs27"}
[12:24:07.051-HttpClient-19][CHANNEL:META_CONNECT]: {"id":"10","successful":true,"channel":"/meta/connect","clientId":"fr1r22f6au89xpm1lbucrp26fs27"}
[12:24:13.348-HttpClient-22][CHANNEL:META_CONNECT]: {"id":"11","successful":true,"channel":"/meta/connect","clientId":"fr1r22f6au89xpm1lbucrp26fs27"}
[12:24:19.643-HttpClient-18][CHANNEL:META_CONNECT]: {"id":"12","successful":true,"channel":"/meta/connect","clientId":"fr1r22f6au89xpm1lbucrp26fs27"}
[12:24:25.935-HttpClient-18][CHANNEL:META_CONNECT]: {"id":"13","successful":true,"channel":"/meta/connect","clientId":"fr1r22f6au89xpm1lbucrp26fs27"}
[12:24:33.429-HttpClient-24][CHANNEL:META_CONNECT]: {"id":"14","successful":true,"channel":"/meta/connect","clientId":"fr1r22f6au89xpm1lbucrp26fs27"}
可能是代理正在缓冲响应。例如,nginx和proxy_buffering on
指令会发生这种情况。