fix: use current url to connect to server (#22)

instead of using absolute path `/webrtc`

Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
Stefan Dej 2022-10-30 17:16:06 +01:00 committed by GitHub
parent 5ff64f2caf
commit d143f3019e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,7 @@
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
fetch('/webrtc', {
fetch(window.location.href, {
body: JSON.stringify({
type: 'request',
res: params.res
@ -109,7 +109,7 @@
}).then(function(answer) {
var offer = pc.localDescription;
return fetch('/webrtc', {
return fetch(window.location.href, {
body: JSON.stringify({
type: offer.type,
id: pc.remote_pc_id,