hummingbird-websocket:Websocket升级对Hummingbird的支持

时间:2024-04-28 18:11:06
【文件属性】:

文件名称:hummingbird-websocket:Websocket升级对Hummingbird的支持

文件大小:28KB

文件格式:ZIP

更新时间:2024-04-28 18:11:06

swift server websocket hummingbird Swift

蜂鸟Websocket 添加了对将HTTP连接升级到WebSocket的支持。 用法 let app = HBApplication () // add HTTP to WebSocket upgrade app. ws . addUpgrade () // add middleware to websocket initial requests app. ws . add ( middleware : HBLogRequestsMiddleware (. info )) // on websocket connect. app. ws . on ( " /ws " ) { req, ws in // send ping and wait for pong and repeat every 60 seconds ws. initiateAutoPing ( interv


【文件预览】:
hummingbird-websocket-main
----.github()
--------FUNDING.yml(20B)
--------workflows()
----Dockerfile(342B)
----LICENSE(11KB)
----Sources()
--------HummingbirdWSClient()
--------HummingbirdWebSocket()
--------HummingbirdWSCore()
----Package.swift(2KB)
----CONTRIBUTING.md(2KB)
----.gitignore(94B)
----.swiftformat(954B)
----Tests()
--------LinuxMain.swift(492B)
--------HummingbirdWebSocketTests()
----CODE_OF_CONDUCT.md(3KB)
----README.md(929B)
----scripts()
--------sanity.sh(4KB)

网友评论