Skip to content

Commit

Permalink
Replace http-server with nginx.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 12, 2024
1 parent 3e74d40 commit 36a01ce
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
set -x
set -e

DEV_PKGS="libc6-dev gcc"
DEV_PKGS="libc6-dev gcc python3-pip"

apt-get -y --no-install-recommends update -qq
apt-get -y --no-install-recommends install python-is-python3 python3-pip npm \
apt-get -y --no-install-recommends install python-is-python3 nginx \
${DEV_PKGS}

python3 -m pip install --break-system-packages -U -r b2bua/requirements.txt
npm install http-server

apt-get -y remove ${DEV_PKGS}
apt-get -y autoremove
Expand Down
19 changes: 19 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
daemon off;

events {}

http {
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name webrtc_phone.local;

ssl_certificate /webrtc_phone/server.crt;
ssl_certificate_key /webrtc_phone/server.key;

location / {
root /webrtc_phone/SIP.js/demo;
index index.html index.htm;
}
}
}
3 changes: 1 addition & 2 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RTPP_LOG_LEVEL="${RTPP_LOG_LEVEL:-"dbug"}"
CFILE="/webrtc_phone/server.crt"
KFILE="/webrtc_phone/server.key"
WROOT="/webrtc_phone/SIP.js/demo"
PNUM=443
MIN_RTP_PORT=32000
MAX_RTP_PORT=34000

Expand All @@ -18,7 +17,7 @@ RMODDIR="/usr/local/lib/rtpproxy"

BDIR="/webrtc_phone/b2bua"

npm exec -- http-server -S -C "${CFILE}" -K "${KFILE}" -p ${PNUM} "${WROOT}" &
nginx -c /webrtc_phone/nginx.conf &
HSERV_PID="${!}"

/usr/local/bin/rtpproxy_debug -f -F -s "${RSOCK}" \
Expand Down

0 comments on commit 36a01ce

Please sign in to comment.