cowboy close connection without response

Hello i have simpy question

In nginx i use 444 code to block unwanted users

444 CONNECTION CLOSED WITHOUT RESPONSE

Is there any way to produce same nginx 444 error in cowboy?

Sending a status code for “no response” sounds like a lie, as the status code is already a response.

Additionally that one isn’t even in the standard.

3 Likes

Though I think you can use any status code you like when calling reply

It’s non-standard but very useful. The “status code” is only used locally; as the name suggests nginx closes the connection without returning any response at all.

1 Like

So this is to be used as a means of communication between the application server and it’s gateway?

Seems as if it were tightly coupling the application to the gateway and makes it hard to exchange it.

Nope, it’s just a way to tell nginx to handle bogus requests by essentially ignoring them. If I’m running a Phoenix app, there’s no reason to even bother returning a 404 for e.g. /wp_admin.php.