This is the work I've done to date with io focused on making websocketclient to be reliable and strongly typed with TypeScript. It's a fairly substantial set of changes, mostly in the .d.ts files but some implementation (especially websocketclient).
Type changes:
New types for embedded:io/socket/tcp/tls, embedded:network/http/server, embedded:network/http/server/options/webpage, embedded:network/https/server/options/websocket, and embedded:network/websocket/client
Improvements to types embedded:io/socket/listener, embedded:io/socket/tcp, embedded:io/socket/udp, embedded:network/dns/resolver/udp, embedded:network/http/client, embedded:provider/builtin
Added Device (for global variable device) into global types to eliminate requirement for import
Extend the global namespace for Device for when imports of extended modules are used (support for embedded:network/http/server, embedded:network/websocket/client)
Implementation changes:
Bug fixes/improvements for websocketclient:
Implement error property via onError(error: string) (new feature)
Fix issue where control message payloads were not being decoded with the mask (data corruption)
Fix an issue where masks were used on both client and server (spec requires masking on client to server only)
Fixed issue where fragmented reads used an improper mask (data corruption)
Fix a bug in websocket where using attached sockets would fail (reported in #1428)
Add common HTTP status codes to httpserver on the HTTP/1.1 <status> <code> header
Added options feature to embedded:network/http/server/options/webpage to support .contentType and .status.
I typed everything based on the current implementation and not ECMA-419 (many modules are inconsistent with the published 2nd edition of the spec).
This is the work I've done to date with
io
focused on makingwebsocketclient
to be reliable and strongly typed with TypeScript. It's a fairly substantial set of changes, mostly in the.d.ts
files but some implementation (especiallywebsocketclient
).Type changes:
embedded:io/socket/tcp/tls
,embedded:network/http/server
,embedded:network/http/server/options/webpage
,embedded:network/https/server/options/websocket
, andembedded:network/websocket/client
embedded:io/socket/listener
,embedded:io/socket/tcp
,embedded:io/socket/udp
,embedded:network/dns/resolver/udp
,embedded:network/http/client
,embedded:provider/builtin
Device
(for global variabledevice
) into global types to eliminate requirement for importDevice
for when imports of extended modules are used (support forembedded:network/http/server
,embedded:network/websocket/client
)Implementation changes:
websocketclient
:onError(error: string)
(new feature)websocket
where using attached sockets would fail (reported in #1428)httpserver
on theHTTP/1.1 <status> <code>
headerembedded:network/http/server/options/webpage
to support.contentType
and.status
.I typed everything based on the current implementation and not
ECMA-419
(many modules are inconsistent with the published 2nd edition of the spec).