Support TCP and Unix socket for wasm-js and js via NodeJS
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.
Please check API and code style build. I would also check publishToMavenLocal.
apiCheck/lintKotlin/publishToMavenLocal works fine locally
Thank you for your contribution! :tada: