public void proxySessionOpened(IoSession session) throws Exception {
logger.debug("CLIENT - Session opened: " + session);
ProxyIoSession proxyIoSession = (ProxyIoSession) session
.getAttribute(ProxyIoSession.PROXY_SESSION);
if (proxyIoSession != null) {
ProxyRequest req = proxyIoSession.getRequest();
byte[] c = null;
if (req instanceof SocksProxyRequest && cmd != null) {
logger.debug("Sending request to a SOCKS SESSION ...");
c = cmd.getBytes(proxyIoSession.getCharsetName());