@Override
    public void run() {
        try {
            System.out.println( "ConnectionAccepter #" + Thread.currentThread().getId() + ": " + serverSocketChannel.getLocalAddress() + " -> " + proxyToAddress);

            while(true) {
                selector.select();
                Set<SelectionKey> selectedKeys = selector.selectedKeys();
                for (SelectionKey key: selectedKeys) {
                    try {
                        if (!key.isValid()) {
                            throw new CancelledKeyException();
                        }

                        if (key.isAcceptable()) {
                            accept();
                        }
                    } catch (CancelledKeyException e) {
                        key.channel().close();
                    }
                }
                selectedKeys.clear();
            }
        } catch (Exception e) {
            System.err.println("Something goes wrong");
            e.printStackTrace();
            System.exit(1);
        }
    }