Am able to create a web socket to wss://echo.websocket.org and receive a reply but when I try connecting to a local esp8266 socket server with the following call, it doesn't work
let socket = WebSocket("wss://10.0.1.83:80")
print("Socket = \(socket)")
socket.open()
socket.send("Test")
socket.event.open = {
print("Socket Opened")
}
socket.event.close = { code, reason, clean in
print("Socket closed")
}
socket.event.error = { error in
print("Socket Error \(error)")
}
socket.event.message = { message in
print("Socket message \(message)")
if let text = message as? String {
self.handleMessage(jsonString: text)
}
}
print("Done")
OUTPUT is
Socket = <SwiftWebSocket.WebSocket: 0x1c003de80>
Done
Also set the delegate and added functions for open, close and error but they don't fire either
When I stop the app, the esp8266 reports a web socket was disconnects, but I never shows one was connected in the first place.
Am able to create a web socket to wss://echo.websocket.org and receive a reply but when I try connecting to a local esp8266 socket server with the following call, it doesn't work
OUTPUT is Socket = <SwiftWebSocket.WebSocket: 0x1c003de80> Done
Also set the delegate and added functions for open, close and error but they don't fire either
When I stop the app, the esp8266 reports a web socket was disconnects, but I never shows one was connected in the first place.