├── .gitignore ├── Dockerfile ├── Readme.md ├── generate_certs.sh ├── nginx.conf ├── nginx ├── gzip.conf ├── security.conf └── ssl.conf ├── package.json ├── supervisor.conf └── web ├── css └── index.css ├── index.html └── js ├── class ├── resultview.js └── turntest.js ├── ice-servers.js ├── turn-test.js └── your-browser.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:xenial 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN sed -i 's/http:\/\/archive.ubuntu.com\/ubuntu\//http:\/\/hu.archive.ubuntu.com\/ubuntu\//' /etc/apt/sources.list 6 | RUN apt-get update && apt-get install -y locales && locale-gen en_US.UTF-8 7 | ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 8 | 9 | ENV NODE_ENV docker 10 | 11 | # update and install needed software 12 | RUN apt-get update \ 13 | && apt-get -y upgrade \ 14 | && apt-get -y install apt-transport-https wget apt-utils nano net-tools \ 15 | && echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" | tee /etc/apt/sources.list.d/nginx.list \ 16 | && wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add - \ 17 | && echo "deb https://deb.nodesource.com/node_6.x xenial main" | tee /etc/apt/sources.list.d/nodesource.list \ 18 | && wget -q -O - https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \ 19 | && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ 20 | && wget -q -O - https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ 21 | && apt-get update \ 22 | && apt-get -y install nginx nodejs build-essential yarn supervisor git 23 | 24 | 25 | # install needes software 26 | RUN mkdir /workspace/ 27 | RUN usermod -aG www-data nginx 28 | COPY nginx/* /etc/nginx/conf.d/ 29 | COPY generate_certs.sh /workspace/ 30 | RUN mkdir -p /var/log/supervisor 31 | RUN useradd ubuntu 32 | RUN usermod -aG www-data ubuntu 33 | 34 | COPY nginx.conf /etc/nginx/conf.d/ 35 | COPY supervisor.conf /etc/supervisor/conf.d/ 36 | 37 | RUN mkdir /workspace/cert \ && /workspace/generate_certs.sh 38 | 39 | WORKDIR /workspace/webrtc-turn-test 40 | 41 | CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Ice Test 2 | 3 | https://icetest.info 4 | 5 | 6 | To run it in a docker container: 7 | ``` 8 | docker build . -t tgabi333/ice-test 9 | docker run -d -p 443:443 -v /workspace/ice-test/:/workspace/ice-test --name ice-test tgabi333/ice-test 10 | docker exec -it ice-test bash 11 | ``` 12 | -------------------------------------------------------------------------------- /generate_certs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | openssl dhparam -out /workspace/cert/dhparam.pem 2048 4 | 5 | openssl req -x509 -newkey rsa:4086 \ 6 | -subj "/C=XX/ST=XXXX/L=XXXX/O=XXXX/CN=localhost" \ 7 | -keyout "/workspace/cert/key.pem" \ 8 | -out "/workspace/cert/cert.pem" \ 9 | -days 3650 -nodes -sha256 10 | 11 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 443 http2 ssl default_server; 3 | 4 | ssl_certificate /workspace/cert/cert.pem; 5 | ssl_certificate_key /workspace/cert/key.pem; 6 | 7 | root /workspace/ice-test/web; 8 | 9 | etag on; 10 | gzip on; 11 | 12 | client_max_body_size 25M; 13 | 14 | location ^~ /js/ { 15 | expires 1y; 16 | } 17 | location ^~ /css/ { 18 | expires 1y; 19 | } 20 | 21 | # location ~ \.(otf|woff|svg|ttf|eot|woff2)$ { 22 | # add_header "Access-Control-Allow-Origin" "*"; 23 | # } 24 | 25 | # location /socket.io { 26 | # proxy_pass http://socketio-oss; 27 | # proxy_http_version 1.1; 28 | # proxy_set_header Upgrade $http_upgrade; 29 | # proxy_set_header Connection "upgrade"; 30 | # } 31 | 32 | location / { 33 | index index.html; 34 | # try_files $uri @nodejs; 35 | } 36 | 37 | # location @nodejs { 38 | # proxy_pass http://vuer-oss; 39 | # proxy_set_header Host $host; 40 | # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 41 | # proxy_set_header X-Forwarded-Proto $scheme; 42 | # } 43 | 44 | # error_page 502 /502.html; 45 | } -------------------------------------------------------------------------------- /nginx/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip_comp_level 2; 2 | gzip_types text/xml text/css application/x-javascript application/javascript text/javascript application/vnd.ms-fontobject font/ttf font/opentype image/svg+xml; 3 | -------------------------------------------------------------------------------- /nginx/security.conf: -------------------------------------------------------------------------------- 1 | server_tokens off; 2 | -------------------------------------------------------------------------------- /nginx/ssl.conf: -------------------------------------------------------------------------------- 1 | ssl_session_timeout 5m; 2 | ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK:!RC4; 3 | ssl_dhparam /workspace/cert/dhparam.pem; 4 | ssl_session_cache shared:SSL:50m; 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tgabi333/ice-test/301a0af69317e0c2b8d4fdce19d7c15355607eef/package.json -------------------------------------------------------------------------------- /supervisor.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx -g "daemon off;" 3 | user=root 4 | autostart=true 5 | stdout_events_enabled=true 6 | stderr_events_enabled=true -------------------------------------------------------------------------------- /web/css/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 5rem; 3 | } 4 | 5 | input { 6 | font-family: 'Roboto Mono', monospace; 7 | } 8 | 9 | #container > .row { 10 | padding-bottom: 3rem; 11 | } 12 | 13 | #stun-form { 14 | padding-bottom: 2rem; 15 | } 16 | 17 | #turn-form .form-row { 18 | padding-bottom: 1rem; 19 | } 20 | 21 | #ice-list .row { 22 | padding-bottom: 1rem; 23 | font-family: 'Roboto Mono', monospace; 24 | } 25 | 26 | 27 | #result-list > .row { 28 | padding-bottom: 1rem; 29 | font-family: 'Roboto Mono', monospace; 30 | } 31 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 |