2

Is there way to connect to apex code with wss (websocket) protocol?

I successfully connected to an external url from Salesforce client component, but I am wondering if there is a way to create a websocket server in Salesforce and connect to it from a client component.

Thank you!

4

Apex only supports HTTP/1 from early 2000's . WebSocket server or GRPC(HTTP/2) are bi-directional and quite latest mid/late 2010's. So natively in Salesforce Apex you cant achieve this.

Client Component you can do that using Javascript, as its websocket API isnative to JS. You have to stick with aura/lwc component.

You can raise an idea for its support in apex here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.