How to use TLS in Play!Framework WebSockets (“wss://”)

后端 未结 4 1627
走了就别回头了
走了就别回头了 2020-12-05 08:51

I cannot use wss:// in my simple WebSocket app created with Play!Framework 2.2. It echoes the message back. The endpoint is like this

def indexW         


        
4条回答
  •  清歌不尽
    2020-12-05 09:03

    wss works fine with Play 2.6.

    Instead of hardcode the websocket url, you can get the url via routes:

    @import play.api.mvc.RequestHeader
    @import controllers.routes
    @()(implicit request: RequestHeader)
    
    
        
            ...
            
        
        
        ...
        
    
    

提交回复
热议问题