becvert/cordova-plugin-websocket-server Address already in use solution

wsserver still open after closing the app? #77

  1. start app
  2. open a server
  3. close the app with the taskmanager (android)
  4. call restartServer function (see below)
    -> “stopped listening on :::9090. Reason: Address already in use”

I met same problem in my source.

But There is no answer


I Found Solution Like this

edit your source:

net/becvert/cordova/WebSocketServerPlugin.java in node_modules.
Add
At line 157
newserver.setReuseAddr(true)

And save then npx cap sync

It works fine !!

Leave a Comment