mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
# Motivation We got reports in https://github.com/apple/swift-nio/issues/2574 that our new typed HTTP upgrader are hitting a Swift compiler bug which manifests in a runtime crash on older iOS/macOS/etc. # Modification This PR backs out the new typed HTTP protocol upgrader APIs so that we can unblock our users until the Swift compiler bug is fixed. # Result No more crashes for our users.
NIOWebSocketClient
This sample application provides a simple WebSocket client. First it performs an upgrade from a HTTP connection. Once upgraded, it sends a 'ping' frame, with a body, to the server. It then checks that the body matches in the returning 'pong' frame. It also prints out any text frame received from the server. Invoke it using one of the following syntaxes:
swift run NIOWebSocketClient # Connects to a server on ::1, port 8888.
swift run NIOWebSocketClient 9899 # Connects to a server on ::1, port 9899
swift run NIOWebSocketClient /path/to/unix/socket # Connects to a server using the given UNIX socket
swift run NIOWebSocketClient echo.example.com 9899 # Connects to a server on echo.example.com:9899