Apigee as websocket proxy

rohitmonga
Participant II

I need apigee as a proxy for my client and server communication, where communication from client ->apigee -> server should flow via websocket. Means inbound and outbound call from apigee should be via websocket.

I don't want a solution which say apigee as HTTP proxy, which will open websocket call to server.

Client -> Apigee (websocket proxy) -> Server (websocket) ===== Please let me know if this is acheivable in apigee.

Client -> Apigee (http proxy) -> Server (websocket) ===== Not looking for this solution

Solved Solved
0 27 7,597
1 ACCEPTED SOLUTION

I want to provide an update: Apigee hybrid does support websockets. https://cloud.google.com/apigee/docs/hybrid/v1.3/websockets

View solution in original post

27 REPLIES 27

@Rohit Monga ,

We don't support web socket at this point of time.

Can we have apigee http proxy which make websocket call to server?

Yes, You can do that using Node.JS Containers in Apigee Edge.

Is apigee working on it to support websocket proxy?

Considering how common web socket usage is, I'm perplexed as to why Apigee doesn't support it. Is there a feature request for this that can be upvoted?

Yes, consider your vote tallied.

We're prioritizing the engineering work for 2019, just now. Websocket and H2 are being considered.

Would the Websocket implementation apply on the Microgateway?

For information, and as said to the Support, websocket is a feature we would need too. Thank you.

@Dino-at-Google

Any update on Websocket support?

@Dino-at-Google Any update on websocket support for the current year 2019?

raghav_pn
Participant I

Any update on websockets please?

Is there any update on this please. Does APIGEE support websockets?

any updates on the websockets please?

I want to provide an update: Apigee hybrid does support websockets. https://cloud.google.com/apigee/docs/hybrid/v1.3/websockets

@Dino - Does Apigee edge support websockets? How is Apigee hybrid different from Apigee edge?

Apigee Edge doesn't support web sockets. However there's the Envoy Adapter which does

The Apigee Hybrid documentation provides a great overview of Apigee Hybrid and differences to Apigee Edge.

You can think of Apigee Edge as the thing that has been available in the cloud since 2012.

In 2019 we launched Apigee hybrid which ... uses much of the same Apigee technology, including the same Apigee gateway.... but it is differently arranged. And as I stated, Apigee hybrid supports websockets.

Also the current Apigee SaaS is based on the Apigee hybrid architecture and it too supports websockets! So if you become a customer now, for Apigee SaaS, you will get webscokets support. Existing customers will need to migrate to the new architecture. Contact your sales team to discuss this.

@dino Trying to get latest on same thread with respect to apigee 4.51.00 supports Web socket with listed scenarios.

A) Client <- -https--> Apigee OPDK 4.51  (websocket proxy) < --- > Server (websocket)

Solution A will require node js but Apigee OPDK node js will not work

B) Client < https-> Apigee OPDK 4.51  (http proxy) <  - -> Server (websocket)

 Either as a solution for A and B: with Apigee OPDK writing custom Java could be solution without any support issues ? 

My Use case uses Apigee OPDK and does not uses Apigee Hybrid/X hence query is for Apigee OPDK 4.51.x. 

 

 

Can you please confirm if Apigee private cloud "4.50.x and.or 4.51.x" supports web sockets ? If yes, any helpful docs please.

WebSocket support on Apigee Private Cloud is only available through the Apigee Adapter for Envoy.

Re: Client -> Apigee X (websocket proxy) -> Server (websocket)

This is supported in Apigee X / Hybrid. Merely set the target to the WSS endpoint and connect with a client.

    <HTTPTargetConnection>
        <URL>wss://demo.piesocket.com/v3/channel_1?api_key={key}&amp;notify_self</URL>
    </HTTPTargetConnection>

 

Thanks @kurtkanaskie! As a follow up, is there an Apigee-native way of sending a message through the websocket connection?

We're looking for something similar to AWS's PostToConnectionCommand class:

import { ApiGatewayManagementApiClient, PostToConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi"; // ES Modules import
// const { ApiGatewayManagementApiClient, PostToConnectionCommand } = require("@aws-sdk/client-apigatewaymanagementapi"); // CommonJS import
const client = new ApiGatewayManagementApiClient(config);
const input = { // PostToConnectionRequest
  Data: "BLOB_VALUE", // required
  ConnectionId: "STRING_VALUE", // required
};
const command = new PostToConnectionCommand(input);
const response = await client.send(command);
// {};

I'm (a) not Kurt, and (b) I'm not familiar with the class you are citing in the AWS SDK, but I would like to respond anyway. From the name (aws-sdk/client-apigatewaymanagementapi), it appears that the client lib is intended to support management of the API Gateway - in other words administrative tasks.  Is that a correct understanding? 

Apigee has a management API - called "the Apigee API " - which is REST-based.  It allows you to programmatically develop and manage API proxies, products, developer accounts, credentials, security controls, and so on, ...  with a set of RESTful operations. Is that what you want? For example you could send a REST request to deploy a Proxy, or undeploy a proxy, or modify a setting in the KVM store, etc. This API is not Websocket. It's REST. 

If you are talking about sending a ws request through an Apigee API Proxy, then... there's no special client library needed. Just use a websocket client library, in whatever platform you use. Java, go, nodejs, rust, C#, Python, whatever. Use the native websocket client library.

For the latter case, Here's a screencast walkthrough. It doesn't show code, it just shows the use of the Postman client to send Websocket requests. 

  

Thanks @dchiesa1! We need the latter, sending a websocket request through an Apigee API Proxy. Your recommendation makes sense. Ideally we were hoping that there was an existing example. Otherwise we can work with the available options.

There are Web Socket native ways of sending a message to an API Proxy that connects to a backend target Web Socket.

You can use: https://www.piesocket.com/websocket-tester and enter the URL: wss://$APIGEEX_HOSTNAME/piesocket where "piesocket" is the basepath to your proxy.

You can also try the sample Web Socket App that Nandan created here: https://github.com/srinandan/sample-apps/blob/v1.84/websockets/client/main.go Run that using: go run main.go -endpoint=$APIGEEX_HOSTNAME -path=/piesocket -tls=true

Does APIGEE Edge for Public Cloud support Websocket?

Apigee X or hybrid.  (Get current!)