public final class Socks5ProxyHandler extends ProxyHandler
ChannelHandler.Sharable
Constructor and Description |
---|
Socks5ProxyHandler(java.net.SocketAddress proxyAddress) |
Socks5ProxyHandler(java.net.SocketAddress proxyAddress, java.lang.String username, java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCodec(ChannelHandlerContext ctx)
添加与代理服务器进行通信所需的编解码器处理程序。
|
java.lang.String |
authScheme()
返回正在使用的认证方案的名称。
|
protected boolean |
handleResponse(ChannelHandlerContext ctx, java.lang.Object response)
处理从代理服务器收到的消息。
|
protected java.lang.Object |
newInitialMessage(ChannelHandlerContext ctx)
返回到代理服务器的连接建立后第一次发送的新消息。
|
java.lang.String |
password() |
java.lang.String |
protocol()
返回正在使用的代理协议的名称。
|
protected void |
removeDecoder(ChannelHandlerContext ctx)
|
protected void |
removeEncoder(ChannelHandlerContext ctx)
|
java.lang.String |
username() |
channelActive, channelInactive, channelRead, channelReadComplete, connect, connectFuture, connectTimeoutMillis, destinationAddress, exceptionCaught, exceptionMessage, flush, handlerAdded, isConnected, proxyAddress, sendToProxyServer, setConnectTimeoutMillis, write
bind, close, deregister, disconnect, read
channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerRemoved
public Socks5ProxyHandler(java.net.SocketAddress proxyAddress)
public Socks5ProxyHandler(java.net.SocketAddress proxyAddress, java.lang.String username, java.lang.String password)
public java.lang.String protocol()
ProxyHandler
protocol
在课堂上
ProxyHandler
public java.lang.String authScheme()
ProxyHandler
authScheme
在课堂上
ProxyHandler
public java.lang.String username()
public java.lang.String password()
protected void addCodec(ChannelHandlerContext ctx) throws java.lang.Exception
ProxyHandler
addCodec
在课堂上
ProxyHandler
java.lang.Exception
protected void removeEncoder(ChannelHandlerContext ctx) throws java.lang.Exception
ProxyHandler
removeEncoder
在课堂上
ProxyHandler
java.lang.Exception
protected void removeDecoder(ChannelHandlerContext ctx) throws java.lang.Exception
ProxyHandler
removeDecoder
在课堂上
ProxyHandler
java.lang.Exception
protected java.lang.Object newInitialMessage(ChannelHandlerContext ctx) throws java.lang.Exception
ProxyHandler
newInitialMessage
在课堂上
ProxyHandler
null
如果代理服务器需要发送第一条消息
java.lang.Exception
protected boolean handleResponse(ChannelHandlerContext ctx, java.lang.Object response) throws java.lang.Exception
ProxyHandler
handleResponse
在课堂上
ProxyHandler
true
如果到目的地的连接已建立,
false
如果尚未建立到目的地的连接并且代理服务器需要更多消息
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.