Post

Replies

Boosts

Views

Created

Can't connect to websocket from macOS game template
Hi, I'm trying to setup a simple websocket connection from the project game template. Using NWWebSocket 0.5.4 or urlSession.webSocketTask on the client and Vapor on the server. Haven't been able to connect since macOS ~14-15 with the same Xcode settings. I can send HTTP routes but the websocket itself does not connect. The closest I've got is connect but then immediate disconnect. I know the websocket works with CLI. Have plist allowing arbitrary loads and local networking. Also App Sandbox with network boxes checked in Debug mode. The error I get is: Error receiving: Error Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server." UserInfo={NSErrorFailingURLStringKey=http://localhost:8090/echo, NSErrorFailingURLKey=http://localhost:8090/echo, _NSURLErrorWebSocketHandshakeFailureReasonKey=5, NSLocalizedDescription=There was a bad response from the server.} Failed to send message: Error Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server." Thanks.
3
0
98
Apr ’25