Issue with WebSocket
Anyone having issues connecting to the web socket? When I try to connect from a browser, the browser gives me an error 404 that it cannot connect.
Anything I could possibly be missing?
Thanks
Found part of the problem. If I have a wildcard url, it overrides the websocket. Perhaps there should be a check for existing paths before using the /: wildcard?
Example below:
let subdir = Bundle.main.resourceURL!.appendingPathComponent("Public")
server["/:"] = shareFilesFromDirectory(subdir.path)
// The line above causes the web socket to not work...
server["/websocket-echo"] = websocket({ (session, text) in
session.writeText(text)
}, { (session, binary) in
session.writeBinary(binary)
})
The bindResult value is not changing and it is showing -1. The problem which I think is mostly because of app settings. Can anyone suggest me what to do?
bindResult = withUnsafePointer(to: &addr) { bind(socketFileDescriptor, UnsafePointer
This is the error which it shows to me. SocketError
bindFailed : "Operation not permitted"
SocketError.bindFailed("Operation not permitted")
Do you have solution for this?