Read Me > FAQ
I'm getting following error:
unable to set up TCP listener: Permission denied (os error 13)
Try to run rts with admin privileges.
I'm getting following error:
unable to set up TCP listener: Address already in use (os error 48)
Some application is already using port 80. Find out PID and stop it.
sudo fuser 80/tcp # works on linux
sudo lsof -i :80 # works on macOS as well as on linux
I started rts on http://127.0.0.1:80, but unable to query it from local network.
Server is running on loopback device. Find out ip address of you network device and restart rts using provided ip.
ifconfig # find ip address
I'm not able to set cookies.
Cookies are not implemented for Rust TLS Server. As a developer you may use localStorage or sessionStorage to bypass absence of the cookies.
I see the following error in console output
the handshake failed: error:14094416:SSL routines:ssl3_read_bytes:sslv3 alert certificate unknown:ssl/record/rec_layer_s3.c:1556:SSL alert number 46
Client may interrupt connection due to various reasons, most of the time you can ignore following message if you are using self-signed certificate.
I see the following error in console output
the handshake failed: unexpected EOF
Client may interrupt connection due to various reasons, most of the time you can ignore following message.
I'm not able to download files from the server by opening it in the browser
Most likely you are using self-signed certificate and as security measure browser won't let you download any files. As a solution you may obtain trusted certificate from Let's Encrypt. To do so you can use http-to-https-letsencrypt.
Alternatively you can run Rust Web Server on other port and download files over unencrypted http connection.
I see the following error in the console:
unable to parse request: invalid utf-8 sequence of n bytes from index m
Server received not properly encoded request in UTF-8 charset. Request may be sent from various software on your network. You can ignore this message.
I see the following error in the console:
unable to parse request: Unable to parse method, request uri and http version
Server received not valid request, for example it may contain a typo or ASCII invisible control characters. Request may be sent from various software on your network. You can ignore this message.
I see the following error in the console(Linux):
unable to set up TCP listener: Cannot assign requested address (os error 99)
Most probably you are trying to start server on port 80. To start server on port 80 try to run it as an administrator or user with admin privileges.
How do I start server on IPv6?
Simply start server with -ip=:: (or -i=::).
I have started server on ip=:: but unable to access it via fe80::... address.
Try to access the server using IPv4 inet address, from the same interface. Internally your IPv4 address will be converted to IPv6 variant [::ffff:192.168.m.n].
I'm trying to open directory, but getting 404 Not Found error.
Directory listing is not implemented. The reason behind this decision is security. To eliminate accidental sharing of unintended files.
As a workaround you can create html file with list of files you need to make available.
I'm not able to connect to server, getting error:
Failed to connect to 192.168.m.n port x after y ms: Connection refused
Most likely firewall is blocking incoming request, try to stop firewall and retry.
I'm not able to start server as root
Command not found
Root does not have /usr/local/bin as part of his $PATH variable. Try to start server by explicitly specifying path to rts: /usr/local/bin/rts
UPDATE 26 Dec 2022: new guideline is to install rts to /usr/bin directory.
I'm trying to build rts from source and getting the error:
linker 'cc' not found
You need to install development tools:
sudo dnf group install "Development Tools" #RHEL and derivatives
sudo yum install cmake make gcc #RHEL and derivatives
sudo apt-get install build-essential # Ubuntu and derivatives
sudo apt-get install make gcc cmake # Ubuntu and derivatives
sudo pacman -S base-devel # Arch Linux
I'm trying to build rts from source and getting the error:
Can't locate FindBin.pm in @INC (you may need to install the FindBin module)
You need to install perl:
sudo dnf install perl # RHEL and derivatives
While building from IDE getting error:
error[E0514]: found crate
NAME
compiled by an incompatible version of rustc
Usually whenever such error encountered by me, I'm performing clean and build from the console, eliminating the built-in IDE compilation, and it works fine.
cargo clean
cargo build
While building from IDE getting error:
error: failed to get
NAME
as a dependency of package `NAME VERSIONfailed to load source for dependency
rust-web-server
Unable to update registry
crates-io
failed to fetch
https://github.com/rust-lang/crates.io-index
failed open - 'PATH.git/FETCH_HEAD' is locked: Permission denied; class=Os (2); code=Locked (-14)
Usually whenever such error encountered by me, I'm performing clean and build from the console as an administrator, eliminating the built-in IDE compilation, and it works fine.
sudo cargo clean
sudo cargo build
While getting sources getting an error:
The following untracked working tree files would be overwritten by merge (checkout): Cargo.lock
Delete Cargo.lock
, it will be regenerated automatically.
rm Cargo.lock