Merge pull request #244 from thecodingmachine/turnserver
Switching on our very own turn server
This commit is contained in:
commit
1ed132145c
@ -26,7 +26,10 @@
|
|||||||
"ports": [80],
|
"ports": [80],
|
||||||
"env": {
|
"env": {
|
||||||
"API_URL": "api."+url,
|
"API_URL": "api."+url,
|
||||||
"JITSI_URL": "meet.jit.si"
|
"JITSI_URL": "meet.jit.si",
|
||||||
|
"TURN_SERVER": "turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443",
|
||||||
|
"TURN_USER": "workadventure",
|
||||||
|
"TURN_PASSWORD": "WorkAdventure123"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"website": {
|
"website": {
|
||||||
|
@ -27,6 +27,9 @@ services:
|
|||||||
NODE_ENV: development
|
NODE_ENV: development
|
||||||
API_URL: api.workadventure.localhost
|
API_URL: api.workadventure.localhost
|
||||||
STARTUP_COMMAND_1: yarn install
|
STARTUP_COMMAND_1: yarn install
|
||||||
|
TURN_SERVER: "turn:coturn.workadventu.re:443,turns:coturn.workadventu.re:443"
|
||||||
|
TURN_USER: workadventure
|
||||||
|
TURN_PASSWORD: WorkAdventure123
|
||||||
command: yarn run start
|
command: yarn run start
|
||||||
volumes:
|
volumes:
|
||||||
- ./front:/usr/src/app
|
- ./front:/usr/src/app
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
const DEBUG_MODE: boolean = process.env.DEBUG_MODE == "true";
|
const DEBUG_MODE: boolean = process.env.DEBUG_MODE == "true";
|
||||||
const API_URL = (typeof(window) !== 'undefined' ? window.location.protocol : 'http:') + '//' + (process.env.API_URL || "api.workadventure.localhost");
|
const API_URL = (typeof(window) !== 'undefined' ? window.location.protocol : 'http:') + '//' + (process.env.API_URL || "api.workadventure.localhost");
|
||||||
|
const TURN_SERVER: string = process.env.TURN_SERVER || "turn:numb.viagenie.ca";
|
||||||
|
const TURN_USER: string = process.env.TURN_USER || 'g.parant@thecodingmachine.com';
|
||||||
|
const TURN_PASSWORD: string = process.env.TURN_PASSWORD || 'itcugcOHxle9Acqi$';
|
||||||
const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL;
|
const JITSI_URL : string|undefined = (process.env.JITSI_URL === '') ? undefined : process.env.JITSI_URL;
|
||||||
const RESOLUTION = 3;
|
const RESOLUTION = 3;
|
||||||
const ZOOM_LEVEL = 1/*3/4*/;
|
const ZOOM_LEVEL = 1/*3/4*/;
|
||||||
@ -13,5 +16,8 @@ export {
|
|||||||
ZOOM_LEVEL,
|
ZOOM_LEVEL,
|
||||||
POSITION_DELAY,
|
POSITION_DELAY,
|
||||||
MAX_EXTRAPOLATION_TIME,
|
MAX_EXTRAPOLATION_TIME,
|
||||||
|
TURN_SERVER,
|
||||||
|
TURN_USER,
|
||||||
|
TURN_PASSWORD,
|
||||||
JITSI_URL
|
JITSI_URL
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import * as SimplePeerNamespace from "simple-peer";
|
import * as SimplePeerNamespace from "simple-peer";
|
||||||
import {mediaManager} from "./MediaManager";
|
import {mediaManager} from "./MediaManager";
|
||||||
import {Connection} from "../Connection";
|
import {Connection} from "../Connection";
|
||||||
|
import {TURN_SERVER, TURN_USER, TURN_PASSWORD} from "../Enum/EnvironmentVariable";
|
||||||
|
|
||||||
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
|
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
|
||||||
|
|
||||||
@ -23,9 +24,9 @@ export class ScreenSharingPeer extends Peer {
|
|||||||
urls: 'stun:stun.l.google.com:19302'
|
urls: 'stun:stun.l.google.com:19302'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
urls: 'turn:numb.viagenie.ca',
|
urls: TURN_SERVER.split(','),
|
||||||
username: 'g.parant@thecodingmachine.com',
|
username: TURN_USER,
|
||||||
credential: 'itcugcOHxle9Acqi$'
|
credential: TURN_PASSWORD
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import * as SimplePeerNamespace from "simple-peer";
|
import * as SimplePeerNamespace from "simple-peer";
|
||||||
import {mediaManager} from "./MediaManager";
|
import {mediaManager} from "./MediaManager";
|
||||||
import {Connection} from "../Connection";
|
import {Connection} from "../Connection";
|
||||||
|
import {TURN_PASSWORD, TURN_SERVER, TURN_USER} from "../Enum/EnvironmentVariable";
|
||||||
|
|
||||||
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
|
const Peer: SimplePeerNamespace.SimplePeer = require('simple-peer');
|
||||||
|
|
||||||
@ -18,14 +19,31 @@ export class VideoPeer extends Peer {
|
|||||||
urls: 'stun:stun.l.google.com:19302'
|
urls: 'stun:stun.l.google.com:19302'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
urls: 'turn:numb.viagenie.ca',
|
urls: TURN_SERVER.split(','),
|
||||||
username: 'g.parant@thecodingmachine.com',
|
username: TURN_USER,
|
||||||
credential: 'itcugcOHxle9Acqi$'
|
credential: TURN_PASSWORD
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('PEER SETUP ', {
|
||||||
|
initiator: initiator ? initiator : false,
|
||||||
|
reconnectTimer: 10000,
|
||||||
|
config: {
|
||||||
|
iceServers: [
|
||||||
|
{
|
||||||
|
urls: 'stun:stun.l.google.com:19302'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
urls: TURN_SERVER,
|
||||||
|
username: TURN_USER,
|
||||||
|
credential: TURN_PASSWORD
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
//start listen signal for the peer connection
|
//start listen signal for the peer connection
|
||||||
this.on('signal', (data: unknown) => {
|
this.on('signal', (data: unknown) => {
|
||||||
this.sendWebrtcSignal(data);
|
this.sendWebrtcSignal(data);
|
||||||
|
@ -42,7 +42,7 @@ module.exports = {
|
|||||||
new webpack.ProvidePlugin({
|
new webpack.ProvidePlugin({
|
||||||
Phaser: 'phaser'
|
Phaser: 'phaser'
|
||||||
}),
|
}),
|
||||||
new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE', 'JITSI_URL'])
|
new webpack.EnvironmentPlugin(['API_URL', 'DEBUG_MODE', 'TURN_SERVER', 'TURN_USER', 'TURN_PASSWORD', 'JITSI_URL'])
|
||||||
],
|
],
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user