docker run --rm -it --network=host aler9/rtsp-simple-server
docker run --rm -it --network=host aler9/rtsp-simple-server
```
```
The `--network=host` argument is mandatory since Docker can change the source port of UDP packets for routing reasons, and this makes RTSP routing impossible. An alternative consists in disabling UDP and exposing the RTSP port:
The `--network=host` argument is mandatory since Docker can change the source port of UDP packets for routing reasons, and this makes RTSP routing impossible. An alternative consists in disabling UDP and exposing the RTSP port, by providing a configuration file:
```
```
docker run --rm -it -p 8554:8554 aler9/rtsp-simple-server --protocols=tcp
docker run --rm -it -p 8554:8554 aler9/rtsp-simple-server stdin <<EOF
protocols: [tcp]
EOF
```
```
#### Publisher authentication
#### Publisher authentication
Start the server and set a username and a password:
Create a file named `conf.yml` in the same folder of the executable, with the following content:
argConfPath:=kingpin.Arg("confpath","path to a config file. The default is conf.yml. Use 'stdin' to read config from stdin").Default("conf.yml").String()
argRtspPort:=kingpin.Flag("rtsp-port","port of the RTSP TCP listener").Default("8554").Int()
argRtpPort:=kingpin.Flag("rtp-port","port of the RTP UDP listener").Default("8000").Int()
argRtcpPort:=kingpin.Flag("rtcp-port","port of the RTCP UDP listener").Default("8001").Int()
argReadTimeout:=kingpin.Flag("read-timeout","timeout of read operations").Default("5s").Duration()
argWriteTimeout:=kingpin.Flag("write-timeout","timeout of write operations").Default("5s").Duration()
argPublishUser:=kingpin.Flag("publish-user","optional username required to publish").Default("").String()
argPublishPass:=kingpin.Flag("publish-pass","optional password required to publish").Default("").String()
argPublishIps:=kingpin.Flag("publish-ips","comma-separated list of IPs or networks (x.x.x.x/24) that can publish").Default("").String()
argReadUser:=kingpin.Flag("read-user","optional username required to read").Default("").String()
argReadPass:=kingpin.Flag("read-pass","optional password required to read").Default("").String()
argReadIps:=kingpin.Flag("read-ips","comma-separated list of IPs or networks (x.x.x.x/24) that can read").Default("").String()
argPreScript:=kingpin.Flag("pre-script","optional script to run on client connect").Default("").String()
argPostScript:=kingpin.Flag("post-script","optional script to run on client disconnect").Default("").String()
argPprof:=kingpin.Flag("pprof","enable pprof on port 9999 to monitor performance").Default("false").Bool()