Skip to content

Conversation

@archey347
Copy link

@archey347 archey347 commented Jan 31, 2025

518bdca:

As connect is called in a non-blocking mode, things like refused connections don't get caught.
The subsequent poll will just block until the socket is ready, and as it's a file operator it doesn't know/care about refused network connections.
Therefore we need to add a check for socket errors after the poll, which should be enough to catch any connection errors.

Without this, 3proxy will return a successful connection response if a remote endpoint returned a packet that would normally indicate a failure, such as a connection refused.

I have only tested this change on linux, with tcp connections over socks.

I'm not sure if this will interfere with UDP though.

This is to return an error when a connection refused packet is returned from the remote host.
As `connect` is called in a non-blocking mode, things like refused connections don't get caught.
The subsequent `poll` will just block until the socket is ready, and as it's a file operator it doesn't know/care about refused network connections.
Therefore we need to add a check for socket errors after the poll, which should be enough to catch any connection errors.
@archey347 archey347 force-pushed the add-socket-error-check branch from 518bdca to 9b949a8 Compare February 2, 2025 19:13
@z3APA3A
Copy link
Collaborator

z3APA3A commented Aug 10, 2025

Should be fixed with e525ce9

@z3APA3A z3APA3A closed this Aug 10, 2025
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.

2 participants