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!

1 Answer 1


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .