Package io.grpc.netty
Class ProtocolNegotiators
java.lang.Object
io.grpc.netty.ProtocolNegotiators
Common
ProtocolNegotiators used by gRPC.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class(package private) static final classprivate static final classstatic final classstatic final class(package private) static final classAdapts aProtocolNegotiationEventto theGrpcHttp2ConnectionHandler.(package private) static final classA tuple of (host, port).(package private) static final classActs as a combination of Http2Upgrade andProtocolNegotiators.GrpcNegotiationHandler.(package private) static final classA negotiator that only does plain text.(package private) static final class(package private) static final class(package private) static final classprivate static final class(package private) static classProtocolNegotiationHandler is a convenience handler that makes it easy to follow the rules for protocol negotiation.(package private) static final classA Proxy handler followsProtocolNegotiators.ProtocolNegotiationHandlerpattern.(package private) static final class(package private) static final class(package private) static final class(package private) static final classWaits for the channel to be active, and then installs the next Handler. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Loggerprivate static final EnumSet<TlsServerCredentials.Feature> private static final EnumSet<TlsChannelCredentials.Feature> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfixedServerFactory(ProtocolNegotiator negotiator) from(ChannelCredentials creds) from(ServerCredentials creds) static ProtocolNegotiatorhttpProxy(SocketAddress proxyAddress, String proxyUsername, String proxyPassword, ProtocolNegotiator negotiator) Returns aProtocolNegotiatorthat does HTTP CONNECT proxy negotiation.(package private) static voidlogSslEngineDetails(Level level, io.netty.channel.ChannelHandlerContext ctx, String msg, Throwable t) (package private) static ProtocolNegotiators.HostPortparseAuthority(String authority) static ProtocolNegotiatorReturns aChannelHandlerthat ensures that thehandleris added to the pipeline writes to theChannelmay happen immediately, even before it is active.static ProtocolNegotiatorReturns aProtocolNegotiatorused for upgrading to HTTP/2 from HTTP/1.x.static ProtocolNegotiatorCreate a server plaintext handler for gRPC.Create a server plaintext handler factory for gRPC.static ProtocolNegotiatorserverTls(io.netty.handler.ssl.SslContext sslContext) Create a server TLS handler for HTTP/2 capable of using ALPN/NPN.static ProtocolNegotiatorserverTls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool) Create a server TLS handler for HTTP/2 capable of using ALPN/NPN.serverTlsFactory(io.netty.handler.ssl.SslContext sslContext) static ProtocolNegotiatortls(io.netty.handler.ssl.SslContext sslContext) Returns aProtocolNegotiatorthat ensures the pipeline is set up so that TLS will be negotiated, thehandleris added and writes to theChannelmay happen immediately, even before the TLS Handshake is complete.static ProtocolNegotiatortls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable) Returns aProtocolNegotiatorthat ensures the pipeline is set up so that TLS will be negotiated, thehandleris added and writes to theChannelmay happen immediately, even before the TLS Handshake is complete.tlsClientFactory(io.netty.handler.ssl.SslContext sslContext) private static RuntimeException
-
Field Details
-
log
-
understoodTlsFeatures
-
understoodServerTlsFeatures
-
-
Constructor Details
-
ProtocolNegotiators
private ProtocolNegotiators()
-
-
Method Details
-
from
-
from
-
fixedServerFactory
-
serverPlaintext
Create a server plaintext handler for gRPC. -
serverPlaintextFactory
Create a server plaintext handler factory for gRPC. -
serverTlsFactory
public static ProtocolNegotiator.ServerFactory serverTlsFactory(io.netty.handler.ssl.SslContext sslContext) -
serverTls
public static ProtocolNegotiator serverTls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool) Create a server TLS handler for HTTP/2 capable of using ALPN/NPN.- Parameters:
executorPool- a dedicatedExecutorpool for time-consuming TLS tasks
-
serverTls
Create a server TLS handler for HTTP/2 capable of using ALPN/NPN. -
httpProxy
public static ProtocolNegotiator httpProxy(SocketAddress proxyAddress, @Nullable String proxyUsername, @Nullable String proxyPassword, ProtocolNegotiator negotiator) Returns aProtocolNegotiatorthat does HTTP CONNECT proxy negotiation. -
parseAuthority
-
tls
public static ProtocolNegotiator tls(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends Executor> executorPool, Optional<Runnable> handshakeCompleteRunnable) Returns aProtocolNegotiatorthat ensures the pipeline is set up so that TLS will be negotiated, thehandleris added and writes to theChannelmay happen immediately, even before the TLS Handshake is complete.- Parameters:
executorPool- a dedicatedExecutorpool for time-consuming TLS tasks
-
tls
Returns aProtocolNegotiatorthat ensures the pipeline is set up so that TLS will be negotiated, thehandleris added and writes to theChannelmay happen immediately, even before the TLS Handshake is complete. -
tlsClientFactory
public static ProtocolNegotiator.ClientFactory tlsClientFactory(io.netty.handler.ssl.SslContext sslContext) -
plaintextUpgrade
Returns aProtocolNegotiatorused for upgrading to HTTP/2 from HTTP/1.x. -
plaintextUpgradeClientFactory
-
plaintext
Returns aChannelHandlerthat ensures that thehandleris added to the pipeline writes to theChannelmay happen immediately, even before it is active. -
plaintextClientFactory
-
logSslEngineDetails
-