Stream: git-wasmtime

Topic: wasmtime / PR #3729 Add CLI options for preopened listen ...


view this post on Zulip Wasmtime GitHub notifications bot (Jan 28 2022 at 13:57):

haraldh edited PR #3729 from wasmtime_listen_cli to main:

As a follow up for https://github.com/bytecodealliance/wasmtime/pull/3711, this implements CLI options to insert pre-opened sockets.

--listenfd : Inherit environment variables and file descriptors following the systemd listen fd specification (UNIX only)

--tcplisten <SOCKET ADDRESS>: Grant access to the given TCP listen socket

TODO

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Feb 01 2022 at 07:46):

haraldh updated PR #3729 from wasmtime_listen_cli to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 04 2022 at 10:36):

haraldh updated PR #3729 from wasmtime_listen_cli to main.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 04 2022 at 10:42):

haraldh edited PR #3729 from wasmtime_listen_cli to main:

As a follow up for https://github.com/bytecodealliance/wasmtime/pull/3711, this implements CLI options to insert pre-opened sockets.

--listenfd : Inherit environment variables and file descriptors following the systemd listen fd specification (UNIX only)

--tcplisten <SOCKET ADDRESS>: Grant access to the given TCP listen socket

TODO

EXAMPLES

$ git clone --branch wasi https://github.com/haraldh/mio.git
$ cd mio
$ cargo +nightly build --target wasm32-wasi --example tcp_server --features="os-poll net"
$ wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
$ ^Z bg
$ echo Hello | nc 127.0.0.1 9000
Hello world!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 04 2022 at 10:43):

haraldh edited PR #3729 from wasmtime_listen_cli to main:

As a follow up for https://github.com/bytecodealliance/wasmtime/pull/3711, this implements CLI options to insert pre-opened sockets.

--listenfd : Inherit environment variables and file descriptors following the systemd listen fd specification (UNIX only)

--tcplisten <SOCKET ADDRESS>: Grant access to the given TCP listen socket

TODO

EXAMPLES

$ git clone --branch wasi https://github.com/haraldh/mio.git
$ cd mio
$ cargo +nightly build --target wasm32-wasi --example tcp_server --features="os-poll net"
$ wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
$ ^Z bg
$ echo Hello | nc 127.0.0.1 9000
Hello world!
$ fg
$ ^C

view this post on Zulip Wasmtime GitHub notifications bot (Feb 04 2022 at 10:44):

haraldh edited PR #3729 from wasmtime_listen_cli to main:

As a follow up for https://github.com/bytecodealliance/wasmtime/pull/3711, this implements CLI options to insert pre-opened sockets.

--listenfd : Inherit environment variables and file descriptors following the systemd listen fd specification (UNIX only)

--tcplisten <SOCKET ADDRESS>: Grant access to the given TCP listen socket

TODO

EXAMPLES

$ git clone --branch wasi https://github.com/haraldh/mio.git
$ cd mio
$ cargo +nightly build --target wasm32-wasi --example tcp_server --features="os-poll net"
$  wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
Using preopened socket FD 3
You can connect to the server using `nc`:
 $ nc <IP> <PORT>
You'll see our welcome message and anything you type will be printed here.
^Z
[1]+  Stopped                 wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
$ bg
$ echo Hello | nc 127.0.0.1 9000
Hello world!
$ fg
$ ^C

view this post on Zulip Wasmtime GitHub notifications bot (Feb 04 2022 at 10:44):

haraldh edited PR #3729 from wasmtime_listen_cli to main:

As a follow up for https://github.com/bytecodealliance/wasmtime/pull/3711, this implements CLI options to insert pre-opened sockets.

--listenfd : Inherit environment variables and file descriptors following the systemd listen fd specification (UNIX only)

--tcplisten <SOCKET ADDRESS>: Grant access to the given TCP listen socket

TODO

EXAMPLES

$ git clone --branch wasi https://github.com/haraldh/mio.git
$ cd mio
$ cargo +nightly build --target wasm32-wasi --example tcp_server --features="os-poll net"
$ wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
Using preopened socket FD 3
You can connect to the server using `nc`:
 $ nc <IP> <PORT>
You'll see our welcome message and anything you type will be printed here.
^Z
[1]+  Stopped                 wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
$ bg
$ echo Hello | nc 127.0.0.1 9000
Hello world!
$ fg
$ ^C

view this post on Zulip Wasmtime GitHub notifications bot (Feb 04 2022 at 10:45):

haraldh edited PR #3729 from wasmtime_listen_cli to main:

As a follow up for https://github.com/bytecodealliance/wasmtime/pull/3711, this implements CLI options to insert pre-opened sockets.

--listenfd : Inherit environment variables and file descriptors following the systemd listen fd specification (UNIX only)

--tcplisten <SOCKET ADDRESS>: Grant access to the given TCP listen socket

TODO

EXAMPLES

$ git clone --branch wasi https://github.com/haraldh/mio.git
$ cd mio
$ cargo +nightly build --target wasm32-wasi --example tcp_server --features="os-poll net"
$ wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
Using preopened socket FD 3
You can connect to the server using `nc`:
 $ nc <IP> <PORT>
You'll see our welcome message and anything you type will be printed here.
^Z
[1]+  Stopped                 wasmtime run --tcplisten 127.0.0.1:9000 --env 'LISTEN_FDS=1' target/wasm32-wasi/debug/examples/tcp_server.wasm
$ bg
$ echo Hello | nc 127.0.0.1 9000
Accepted connection from: 0.0.0.0:0
Hello world!
Received data: Hello
Connection closed
$ fg
$ ^C

view this post on Zulip Wasmtime GitHub notifications bot (Feb 07 2022 at 22:26):

sunfishcode submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 07 2022 at 22:26):

sunfishcode merged PR #3729.


Last updated: Nov 22 2024 at 17:03 UTC