Send :stop to terminate remote websocket


I have a cowboy phoenix websocket server.

I’m on pid 02 and I want to close the pid 01 and his cowboy websocket.

What is the correct way to do?

If I use Process.exit or terminate(:remote, pid) works with an error on HTTP

I need to pass a :close or :stop to the remote pid, so him can terminate gracefully by himself.

How to pass this command? send( pid : ???

Thank you

So you have direct Cowboy websocket handlers, i.e. the low level Cowboy API or you are using Phoenix Channels? I have a code somewhere for Phoenix Channels how to do that but not for the former…

I use Cowboy directly, but please send me an example with Phoenix Channels, I’ll then will take a look to the source code to see how to behave…

1 Like