You need to sign in to do that
Don't have an account?
Mrityunjaya Vashishtha
How to use web sockets in salesforce ??
Hello, I want to integrate real time data using web-sockets. I have no idea where to start and what steps to follow. Please Help.
I found few related posts that should help you get started:
>>According to https://salesforce.stackexchange.com/questions/255240/create-a-websocket-server-hosted-on-salesforce-lightning , You wouldn't be able to host a WS server in Salesforce, you'd need Heroku, Amazon EB/etc, or another type of server. Salesforce doesn't have any way to host custom services like this.
>>From https://developer.salesforce.com/docs/atlas.en-us.secure_coding_guide.meta/secure_coding_guide/secure_coding_websockets.htm Example code to create a secure WebSocket:
>>How to connect to websocket in Lightning: https://salesforce.stackexchange.com/questions/95442/how-to-connect-to-websocket-in-lightning?rq=1
>> Apex Websocket server: https://salesforce.stackexchange.com/questions/264672/apex-websocket-server
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.
If this information helps, please mark the answer as best. Thank you
All Answers
I found few related posts that should help you get started:
>>According to https://salesforce.stackexchange.com/questions/255240/create-a-websocket-server-hosted-on-salesforce-lightning , You wouldn't be able to host a WS server in Salesforce, you'd need Heroku, Amazon EB/etc, or another type of server. Salesforce doesn't have any way to host custom services like this.
>>From https://developer.salesforce.com/docs/atlas.en-us.secure_coding_guide.meta/secure_coding_guide/secure_coding_websockets.htm Example code to create a secure WebSocket:
>>How to connect to websocket in Lightning: https://salesforce.stackexchange.com/questions/95442/how-to-connect-to-websocket-in-lightning?rq=1
>> Apex Websocket server: https://salesforce.stackexchange.com/questions/264672/apex-websocket-server
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.
If this information helps, please mark the answer as best. Thank you
Thanks for the information.
Could you please elaborate on this sentence: "Client Component you can do that using Javascript, as its websocket API isnative to JS. You have to stick with aura/lwc component."?
Does it mean we could have WS server in the aura/lwc?