Skip to content

fix(server): close connection when not allowed by --allow #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nemith
Copy link

@nemith nemith commented Jul 24, 2025

I explicitly set my allow list to 127.0.0.1/32 and was surprised that with my server settings like that connections from the client would freeze indefinitely with no errors in the logs.

Digging into the problem showed that when an IP is denied it just continues for the next connection leaving the old connection to just leak and never close.

This adds explicit close. It may be better to have handle function that make sure close is in a defer to prevent future issues but that is more refactoring here. Also adds some logging when a connection is denied so that it isn't silent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant