rustdesk / rustdesk/rustdesk-server
Rustdesk does not honor the X-Real-IP header.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 10.4k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
On the “devices” tab of RustDesk, I can see the local IP address of my firewall displayed.
I would like to have the public IP address of the client connecting.
The RustDesk ports are open in Port Forwarding directly on the RustDesk machine. However, port 80,443 redirects to my reverse proxy, which NATs to 21114.
PHP gives me the correct address, but RustDesk does not.
Also, 10.1.0.3 is not the IP address of the reverse proxy, but of the firewall.
Describe the environment
- Install environment: Docker (install script of rustdesk)
- Version : Welcome to RustDesk Server Pro 1.6.3
How to Reproduce the bug
Steps to reproduce the behavior:
- Log in into web interface
- Go into "Devices"
- See local IP in "info" column
Expected behavior
Have the public IP of client
Additional context
Reverse proxy conf :
server {
listen 80;
server_name XXXX;
location / {
return 301 https://$server_name$request_uri;
}
}
# https
server {
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/XXXX/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/XXXX/privkey.pem;
server_name XXXX;
location / {
proxy_pass http://server:21114;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /ws/id {
proxy_pass http://server:21118;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
location /ws/relay {
proxy_pass http://server:21119;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
client_max_body_size 200M;
client_body_buffer_size 100M;
proxy_max_temp_file_size 0;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
send_timeout 600s;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no source files or tests. Start by tracing how the Devices tab obtains and displays the client IP, then reproduce the behavior through the supplied reverse-proxy configuration with its X-Real-IP header. Done means the web interface shows the public client IP rather than the firewall or proxy address.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100