github vapor/vapor 4.0.0-alpha.2
Vapor 4.0.0 Alpha 2

latest releases: 4.97.0, 4.96.0, 4.95.0...
pre-release4 years ago
  • Updated to OpenCrypto alpha 2 (#2031)
  • Updated to SSWG's official AsyncHTTPClient package (#2031)
  • Merged server and client websocket code into WebSocket (#2031)
// client 
return WebSocket.connect(
    to: "ws://echo.websocket.org/",
    on: req.eventLoop
) { ws in
    ws.send("Hello, world!")
    ws.onText { ws, text in
        promise.succeed(text)
        ws.close().cascadeFailure(to: promise)
    }
}

// server
router.webSocket("bar") { req, ws in
    ws.send("Hello, world!")
    ws.onText { ws, text in
        promise.succeed(text)
        ws.close().cascadeFailure(to: promise)
    }
}
  • BCrypt renamed to Bcrypt and included in Vapor (#2031)
let hash = try Bcrypt.hash("vapor")
print(hash) // $2b$12$Lmw/Zx2jSXgxE.r/8uipROCoh64KdPL7/mdEz38EqEFZDEu5JsAH2
try Bcrypt.verify("vapor", created: hash) // true
try Bcrypt.verify("foo", created: hash) // false

Don't miss a new vapor release

NewReleases is sending notifications on new releases.