final ConfiguredServerEndpoint configuredServerEndpoint = createConfiguredServerEndpoint(
selectedProtocol, selectedExtensions, endpoint, servletRequest);
final Handshake handshake = getHandshakeToUse(exchange, configuredServerEndpoint);
exchange.upgradeChannel(new HttpUpgradeListener() {
@Override
public void handleUpgrade(StreamConnection connection, HttpServerExchange serverExchange) {
WebSocketChannel channel = handshake.createChannel(exchange, connection, exchange.getBufferPool());
if (peerConnections != null) {
peerConnections.add(channel);