ktor icon indicating copy to clipboard operation
ktor copied to clipboard

Support TCP and Unix socket for wasm-js and js via NodeJS

Open whyoleg opened this issue 1 year ago • 2 comments

Subsystem ktor-network

Motivation Fixes https://youtrack.jetbrains.com/issue/KTOR-6004/Support-NodeJs-target-for-ktor-network

This is the first PR in a series to support ktor client/server for all targets available. Following PRs will contain CIO server and client engines support for NodeJS. The whole scope of changes can be found here.

Fully commonizing ktor-network and other modules, will also significantly simplify (from the build-logic perspective) support for wasm-wasi in ktor-network and through the whole stack of ktor

Solution Use node:net for sockets. SelectorManager is no-op for nodejs, as there is no need for it. Still it's better to commonize it to simplify the configuration. It will probably be also needed for wasm-wasi support. In future, more high-level API could be introduced for sockets and SelectorManager could be made internal.

whyoleg avatar Oct 18 '24 07:10 whyoleg

Please check API and code style build. I would also check publishToMavenLocal.

e5l avatar Oct 18 '24 08:10 e5l

apiCheck/lintKotlin/publishToMavenLocal works fine locally

whyoleg avatar Oct 18 '24 09:10 whyoleg

Thank you for your contribution! :tada:

osipxd avatar Oct 31 '24 13:10 osipxd