Fix linting errors, export mediasoup server
parent
f44bde4ef4
commit
313ce81685
|
|
@ -3,15 +3,15 @@ module.exports =
|
|||
// oAuth2 conf
|
||||
oauth2 :
|
||||
{
|
||||
client_id : '',
|
||||
client_secret : '',
|
||||
providerID : '',
|
||||
redirect_uri : 'https://mYDomainName:port/auth-callback',
|
||||
client_id : '',
|
||||
client_secret : '',
|
||||
providerID : '',
|
||||
redirect_uri : 'https://mYDomainName:port/auth-callback',
|
||||
authorization_endpoint : '',
|
||||
userinfo_endpoint : '',
|
||||
token_endpoint : '',
|
||||
scopes : { request : [ 'openid', 'userid','profile'] },
|
||||
response_type : 'code'
|
||||
userinfo_endpoint : '',
|
||||
token_endpoint : '',
|
||||
scopes : { request: [ 'openid', 'userid', 'profile' ] },
|
||||
response_type : 'code'
|
||||
},
|
||||
// Listening hostname for `gulp live|open`.
|
||||
domain : 'localhost',
|
||||
|
|
@ -22,7 +22,7 @@ module.exports =
|
|||
},
|
||||
// Listening port for https server.
|
||||
listeningPort : 3443,
|
||||
mediasoup :
|
||||
mediasoup :
|
||||
{
|
||||
// mediasoup Server settings.
|
||||
logLevel : 'warn',
|
||||
|
|
|
|||
|
|
@ -15,20 +15,30 @@ const gulp = require('gulp');
|
|||
const plumber = require('gulp-plumber');
|
||||
const eslint = require('gulp-eslint');
|
||||
|
||||
const LINTING_FILES =
|
||||
[
|
||||
'gulpfile.js',
|
||||
'server.js',
|
||||
'config.example.js',
|
||||
'lib/**/*.js'
|
||||
];
|
||||
|
||||
gulp.task('lint', () =>
|
||||
{
|
||||
const src =
|
||||
[
|
||||
'gulpfile.js',
|
||||
'server.js',
|
||||
'config.example.js',
|
||||
'lib/**/*.js'
|
||||
];
|
||||
|
||||
return gulp.src(src)
|
||||
return gulp.src(LINTING_FILES)
|
||||
.pipe(plumber())
|
||||
.pipe(eslint())
|
||||
.pipe(eslint.format());
|
||||
});
|
||||
|
||||
gulp.task('lint-fix', function()
|
||||
{
|
||||
return gulp.src(LINTING_FILES)
|
||||
.pipe(plumber())
|
||||
.pipe(eslint({ fix: true }))
|
||||
.pipe(eslint.format())
|
||||
.pipe(gulp.dest((file) => file.base));
|
||||
});
|
||||
|
||||
gulp.task('default', gulp.series('lint'));
|
||||
|
|
|
|||
|
|
@ -233,8 +233,8 @@ class Room extends EventEmitter
|
|||
accept();
|
||||
|
||||
this._protooRoom.spread('profile-picture-changed', {
|
||||
peerName: protooPeer.id,
|
||||
picture: request.data.picture
|
||||
peerName : protooPeer.id,
|
||||
picture : request.data.picture
|
||||
}, [ protooPeer ]);
|
||||
|
||||
break;
|
||||
|
|
@ -284,7 +284,7 @@ class Room extends EventEmitter
|
|||
this._protooRoom.spread(
|
||||
'raisehand-message',
|
||||
{
|
||||
peerName : protooPeer.id,
|
||||
peerName : protooPeer.id,
|
||||
raiseHandState : raiseHandState
|
||||
},
|
||||
[ protooPeer ]);
|
||||
|
|
|
|||
|
|
@ -316,4 +316,6 @@ function stdinError(msg)
|
|||
{
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(colors.red.bold('ERROR: ') + colors.red(msg));
|
||||
}
|
||||
}
|
||||
|
||||
export default mediaServer;
|
||||
|
|
@ -21,7 +21,7 @@ console.log('- config.mediasoup.logTags:', config.mediasoup.logTags);
|
|||
/* eslint-enable no-console */
|
||||
|
||||
// Start the mediasoup server.
|
||||
require('./mediasoup');
|
||||
const mediaServer = require('./mediasoup');
|
||||
|
||||
const logger = new Logger();
|
||||
|
||||
|
|
@ -58,22 +58,25 @@ app.get(
|
|||
if (rooms.has(req.query.roomId))
|
||||
{
|
||||
const room = rooms.get(req.query.roomId)._protooRoom;
|
||||
if ( room.hasPeer(req.query.peerName) )
|
||||
|
||||
if (room.hasPeer(req.query.peerName))
|
||||
{
|
||||
const peer = room.getPeer(req.query.peerName);
|
||||
|
||||
peer.send('auth', {
|
||||
name: req.user.displayName,
|
||||
picture: req.user.photos[0]
|
||||
name : req.user.displayName,
|
||||
picture : req.user.photos[0]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// Serve all files in the public folder as static files.
|
||||
app.use(express.static('public'));
|
||||
|
||||
const httpsServer = https.createServer(tls, app);
|
||||
|
||||
httpsServer.listen(config.listeningPort, '0.0.0.0', () =>
|
||||
{
|
||||
logger.info('Server running on port: ', config.listeningPort);
|
||||
|
|
|
|||
Loading…
Reference in New Issue