As announced in the last release blog post this release adds three new capabilities to our web crypto implementation: key generation, signing, and sig

Deno 1.12 Release Notes

submited by
Style Pass
2021-07-13 17:00:09

As announced in the last release blog post this release adds three new capabilities to our web crypto implementation: key generation, signing, and signature verification.

This release adds support for upgrading incoming HTTP requests on the unstable HTTP server to WebSocket connections. Just like the native HTTP server itself this feature is still unstable and has not yet been thoroughly battle tested. Please report any issues you encounter. Over the last weeks we have fixed all known bugs in the HTTP implementation and are tentatively planning to stabilize the native HTTP API for 1.13.

To upgrade an incoming Request to a WebSocket you use the Deno.upgradeWebSocket function. This returns an object consisting of a Response and a WebSocket object. The returned response should be used to respond to the incoming request using the respondWith method. At this point the WebSocket is activated and can be used.

Because websocket is a symmetrical protocol, the WebSocket object is identical to the one that can be used for client side communication. Documentation for it can be found on MDN. We are aware that this API can be challenging to use, and are planning to switch to WebSocketStream once it is stabilized and ready for use.

Leave a Comment