Skip to content

Commit 17a2aae

Browse files
helje5Lukasa
authored andcommitted
Add WebSocketUpgrader to channel config (#340)
Motivation: The NIOWebSocketServer demo works much better, when it actually configures the WebSocketUpgrader. You should have a test for that! Modifications: This adds the `upgrader` to the `HTTPUpgradeConfiguration`. Result: The demo will actually perform something web-sockety.
1 parent 56b540b commit 17a2aae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/NIOWebSocketServer/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ let bootstrap = ServerBootstrap(group: group)
210210

211211
// Set the handlers that are applied to the accepted Channels
212212
.childChannelInitializer { channel in
213-
let config: HTTPUpgradeConfiguration = (upgraders: [], completionHandler: { _ in })
213+
let config: HTTPUpgradeConfiguration = (upgraders: [ upgrader ], completionHandler: { _ in })
214214
return channel.pipeline.configureHTTPServerPipeline(withServerUpgrade: config).then {
215215
channel.pipeline.add(handler: HTTPHandler())
216216
}

0 commit comments

Comments
 (0)