Skip to content

Close selector's channels on shutdown #12

Closed
@cpiotr

Description

When TCP Proxy is shut down, underlying socket remains open.

For example, when a proxy is started:

StaticTcpProxyConfig config = new StaticTcpProxyConfig(12345, "github.com", 80);
config.setWorkerCount(1);
TcpProxy proxy = new TcpProxy(config);
proxy.start();

it is possible to connect to it using netcat:

> echo -e "GET / HTTP/1.0\r\n" | nc localhost 12345
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https:///
Connection: close

However, even though the proxy is shut down:

proxy.shutdown();

It is still possible to connect to socket listening on the specified port:

> echo -e "GET / HTTP/1.0\r\n" | nc localhost 12345
HTTP/1.1 301 Moved Permanently
Content-length: 0
Location: https:///
Connection: close

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions