faye / faye-websocket-ruby

Standards-compliant WebSocket client and server
Other
1.04k stars 96 forks source link

How can we use secure websocket in faye gem? #122

Closed shubhamjaincav closed 4 years ago

shubhamjaincav commented 4 years ago

please let me know how can i make wss connection using faye?

ws = Faye::WebSocket::Client.new('ws://localhost:80/non-secure/websocket') is running fine with faye gem, but not running wss client,

wss = Faye::WebSocket::Client.new('wss://localhost:443/secure/websocket')

please let me know the configuration and keyword to enable secure.

jcoglan commented 4 years ago

When you use a wss: URI with Faye::WebSocket::Client, the library will initiate a TLS connection with the server. In this case the service running on localhost:443 would need to implement a TLS or HTTPS service with a valid certificate for the localhost domain.