# File Descriptor Socket Passing
**SWS** provides the ability to accept a socket listener as a file descriptor for use in sandboxing and on-demand applications via `systemd` (Linux), `launchd` (Macos) or similar.
!!! tip "Tip"
The [Socket Activation](http://0pointer.de/blog/projects/socket-activation.html) model is an alternative to TCP port binding.
Socket activation is supported by the `-f, --fd` option or the equivalent [SERVER_LISTEN_FD](./../configuration/environment-variables.md#server_listen_fd) env.
If you are using `inetd`, its "`wait`" option should be used in conjunction with static-web-server's `--fd 0`
option.
## Systemd
If you're using `systemd` on Linux, there is a fully working example in the SWS Git repository under the [.`/systemd`](https://github.com/static-web-server/static-web-server/tree/master/systemd) directory.
### Service example
Below is a `systemd` service example. Follow the steps to create an SWS service using HTTP2 (`static-web-server.service`).
The service will bind SWS to a TCP `443` privileged port without running the server as root.
If you want to change the server port used by the service, edit the value of `ListenStream` in the `static-web-server.socket` file.
The template files can be found in [.`/systemd`](https://github.com/static-web-server/static-web-server/tree/master/systemd) directory.
```sh
cp systemd/etc_default_static-web-server /etc/default/static-web-server
cp systemd/static-web-server.s* /etc/systemd/system/
sudo mkdir /etc/static-web-server
sudo cp tests/tls/local.dev_cert.ecc.pem /etc/static-web-server/
sudo cp tests/tls/local.dev_key.ecc.pem /etc/static-web-server/
sudo mkdir -p /var/www/html
sudo sh -c 'echo "<h1>Static Web Server is running!</h1>" > /var/www/html/index.html'
sudo systemctl daemon-reload
sudo systemctl start static-web-server.service
sudo systemctl status static-web-server.service
sudo systemctl enable static-web-server.service
sudo systemd-analyze security static-web-server.service
```
## Testing
Alternatively, the lightweight [`systemfd`](https://github.com/mitsuhiko/systemfd) utility may be useful, especially for testing purposes.
For example, using `systemfd` utility as follows:
```sh
sudo systemfd --no-pid -s http::8091 -- path/to/static-web-server --fd 0
```
Or if you want to test using an environment variables file then you could use [Enve](https://github.com/joseluisq/enve).
```sh
sudo enve -f /path/to/environment.env systemfd --no-pid -s http::443 -- path/to/static-web-server --fd 0
```