I am trying to create a Websocket Server on my local machine by doing:
WebSocketServer server = new WebSocketServer("ws://127.0.0.1:5040");
but I am getting the error:
An attempt was made to access a socket in a way forbidden by its access permissions
even though netstat -an
shows that the port 5040
is in the LISTENING
state.
I have tried running Visual Studio in admin mode, disabled my firewalls etc. but I keep getting the error. Am I supposed to use a port that does not appear when running netstat -an
? If not, how do I fix the above error?