|
4 months ago | |
---|---|---|
.gitignore | 5 months ago | |
.gitlab-ci.yml | 4 months ago | |
Dockerfile | 4 months ago | |
README.md | 4 months ago | |
build.sh | 4 months ago | |
entrypoint.sh | 4 months ago | |
lighttpd.conf | 4 months ago |
Try setting SINGLE_ROOM
to 1 if you cannot see other peers, note that this would make everyone able to see each other regardless of their connection method.
Environment | Default value | Description |
---|---|---|
HTTP_PORT | 8080 | Port of internal Lighttpd proxy, set to 0 to disable |
PORT | 3000 | Port of Snapdrop WebSocket server |
SINGLE_ROOM | 0 | Single room mode (all peers see each other on the same server regardless of network) |
STUN_SERVER | stun:stun.l.google.com:19302 | STUN server URL |
docker run -d \
--name snapdrop \
-e HTTP_PORT=8080 \
-e PORT=3000 \
-e SINGLE_ROOM=0 \
-e STUN_SERVER=stun:stun.l.google.com:19302 \
-p 3000:3000 `# optional: only if not using Lighttpd proxy in container` \
-p 8080:8080 \
-v /var/www/snapdrop:/home/node/client `# optional: only if not using Lighttpd proxy in container` \
--restart unless-stopped \
jarylc/snapdrop
snapdrop:
image: jarylc/snapdrop
ports:
- "3000:3000" # optional: only if not using Lighttpd proxy in container
- "8080:8080"
volumes: # optional: only if not using Lighttpd proxy in container
- /var/www/snapdrop:/home/node/client
environment:
- HTTP_PORT=8080
- PORT=3000
- SINGLE_ROOM=0
- STUN_SERVER=stun:stun.l.google.com:19302
restart: unless-stopped
Just assign the container's Lighttpd port (HTTP_PORT
) to the designated port on the host you will access Snapdrop with.
location / { # trailing slash is required if under a subpath
proxy_pass http://127.0.0.1:8080/; # trailing slash is important if under a subpath
proxy_connect_timeout 300;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}
location / {
root /var/www/snapdrop;
index index.html;
}
location /server {
proxy_pass http://127.0.0.1:3000;
proxy_connect_timeout 300;
proxy_http_version 1.1;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}
location /snapdrop {
alias /var/www/snapdrop;
index index.html;
}
location /snapdrop/server {
proxy_pass http://127.0.0.1:3000;
proxy_connect_timeout 300;
proxy_set_header Connection "upgrade";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Forwarded-for $remote_addr;
}