APIGEE as reverse proxy for BAYEUX / COMETD

Hi,

Is there a way implement APIGEE as reverse proxy to connect to CometD with a nodeJS client? I tried using FAYE as well as JSFORCE to connect to CometD. When going through proxy, handshake happens, but subscribe to topic fails with cookie error - cookie missing. This cookie seems to be returned via handshake response.

0 2 461
2 REPLIES 2

I believe CometD uses websocket.

Apigee currently does not proxy websocket.

For proxying websocket, you could try Envoy proxy. It supports Websocket upgrades explicitly.


regarding Bayeux

It is my understanding that The Bayeux protocol is an application protocol, and it is required to run on top of a transport protocol such as HTTP or WebSocket.

If you run it on top of HTTP, then Apigee can proxy it.

but: Apigee was not designed to be a "Comet-oriented" HTTP proxy. It was not designed to hold requests open indefinitely. The timeouts on API calls (HTTP calls) in Apigee is usually set to 55 seconds. That means your "long poll" isn't very long. After 55 seconds, the Apigee service will timeout and terminate the connection to the backend and then return a timeout response (504) to the client. This may or may not be a good thing for your application.

CometD supports both websocket and longpolling. Is there an example of long polling using bayeux protocol as CometD uses bayeux protocol?