Swiftpack.co - Package - vapor/websocket-kit

Github

link
Stars: 121

Releases

Fix Atomic Deprecation - 2020-01-22 17:50:36

Fixes Atomic deprecation (fixes #53)

wss:// fix - 2020-01-20 17:24:41

Fixes a small issue with regards to forwarding bytes on a wss websocket. Also ups NIO version to 2.11.1 because of https://github.com/apple/swift-nio/pull/1280.

Add ping/pong callbacks to WebSocket - 2019-12-16 22:09:20

  • Adds onPing and onPong callbacks to WebSocket (#45)

Although WebSocketKit handles ping / pong automatically according to spec, it can be useful to know when these events happen.

ws.onPong { ws in
    print("pong received")
}

ws.onPing { ws in
    print("ping received")
}
  • Adds WebSocket.closeCode containing WebSocketErrorCode that is set when the WebSocket closes (#45)

  • HTTPHeaders are now passed through WebSocket.connect calls (#45)

WebSocketKit 2.0.0 Beta 2 - 2019-12-09 15:34:58

  • Fixed wss:// default port. (#47, #48)

  • Enabled test discovery on Linux (#50)

WebSocketKit 2.0.0 Beta 1 - 2019-10-24 19:09:58

This package has been renamed to WebSocketKit. It now focuses on supplying a WebSocket client modeled after async-http-client. WebSocket server is still supported, but it is expected that you will bring your own NIO ServerBootstrap.

For usage examples, check out the tests folder: https://github.com/vapor/websocket-kit/blob/master/Tests/WebSocketKitTests/NIOWebSocketClientTests.swift

WebSocket 1.1.2 - 2019-03-26 17:04:16

Fixed:

  • Fixed a reference cycle in WebSocket.

WebSocket 1.1.1 - 2019-01-17 18:16:59

Fixed:

  • WebSocket now buffers incoming messages before callbacks are set. (#31)

WebSocket 1.1.0 - 2018-10-16 18:37:26

New:

  • New send(raw:opcode:fin:promise:) method on WebSocket. (#28)
ws.send(raw: "Hello, ", opcode: .text, fin: false)
ws.send(raw: "world", opcode: .continuation, fin: false)
ws.send(raw: "!", opcode: .continuation)
  • WebSocket server now supports parsing continuation frames from the client. (#27)

Fixed:

  • WebSocket client now properly masks pong frame. (#26)

Websocket 1.0.2 - 2018-09-19 13:00:04

Fixes masking frame issue in client mode. Thanks @pvels

WebSocket 1.0.1 - 2018-05-09 02:40:01

New:

  • Added support for sending / receiving WebSocket close codes (#6, #3).
ws.onCloseCode { closeCode in
    print(closeCode)
}
ws.close(code: .normalClosure)
  • Max frame size is now configurable for both WebSocket client and server (#7, #4).
  • You can now specify extra headers to add during WebSocket client upgrade (#2).

Fixed:

  • WebSocket.isClosed is now properly set to true when closed (#8, #5).

Milestone: 1.0.1

WebSocket 1.0.0 - 2018-04-18 21:53:00

Introducing WebSocket 1.0 🎉 🔌 Non-blocking, event-driven WebSocket client and server built on Swift NIO.

Docs: https://docs.vapor.codes/3.0/websocket/getting-started/

API Docs: https://api.vapor.codes/websocket/latest/WebSocket/


This module has been moved from the old vapor/engine repo to its own package. This will make it easier to version going forward 🙌.

Milestone: 1.0.0