session destroy fixed
This commit is contained in:
@@ -1,19 +1,16 @@
|
||||
{
|
||||
"ip" : "192.168.1.115",
|
||||
"port" : 3002,
|
||||
"external_ip" : "192.168.1.115",
|
||||
"external_port" : 3002,
|
||||
"port":3002,
|
||||
"external_domain":"a1.session.graff.tech",
|
||||
"coordinator_domain":"a1.coord.graff.tech",
|
||||
"server_id":"1acd21dc6b70961f10ad134fb6403985",
|
||||
"session_ports":{
|
||||
"count": 50,
|
||||
"app_begin": 47000,
|
||||
"http_begin": 47500
|
||||
},
|
||||
"coordinator":{
|
||||
"ip":"192.168.1.115",
|
||||
"port":3001
|
||||
"app_begin":47500,
|
||||
"http_begin":47000
|
||||
},
|
||||
"start_nginx":115,
|
||||
"cors":[
|
||||
"http://192.168.1.115:3001"
|
||||
"a1.coord.graff.tech",
|
||||
"http://192.168.1.115"
|
||||
],
|
||||
"webrtc_args_static":{
|
||||
"cirrus_path":"D:/shared/Builds/Ivaz_Optimized_2/Samples/PixelStreaming/WebServers/SignallingWebServer/cirrus.js"
|
||||
|
||||
@@ -7,36 +7,36 @@ const http_client = require('../../lib/http_client.js')
|
||||
|
||||
const app_port_begin = config.session_ports.app_begin
|
||||
const http_port_begin = config.session_ports.http_begin
|
||||
const ports_count = config.session_ports.count
|
||||
|
||||
const app_args_static = config.app_args_static
|
||||
const app_args_ip = config.app_args_runtime.ip
|
||||
const server_ip = config.external_ip
|
||||
const server_port = config.external_port
|
||||
const server_ip = '127.0.0.1'//config.ip
|
||||
const external_domain = config.external_domain
|
||||
const app_args_port = config.app_args_runtime.port
|
||||
const start_nginx = config.start_nginx
|
||||
const server_id = config.server_id
|
||||
|
||||
const webrtc_cirrus_path = config.webrtc_args_static.cirrus_path
|
||||
|
||||
const coordinator_port = config.coordinator.port
|
||||
const coordinator_ip = config.coordinator.ip
|
||||
const coordinator_domain = config.coordinator_domain
|
||||
|
||||
// const http_client = require('../lib/http_client.js')
|
||||
|
||||
// SHALL FIX IT IN FUTURE BECAUSE IT IS NOT THE REST API
|
||||
const ports_count = 50
|
||||
var app_port_alloc = new port_alloc(app_port_begin, ports_count)
|
||||
var http_port_alloc = new port_alloc(http_port_begin, ports_count)
|
||||
|
||||
// close all own sessions on session server if emergency shutdown
|
||||
http_client.get({
|
||||
host: coordinator_ip,
|
||||
port: coordinator_port,
|
||||
path: `/session_server/emergency_shutdown?ip=${server_ip}&port=${server_port}`
|
||||
http_client.gets({
|
||||
host: coordinator_domain,
|
||||
path: `/session_server/emergency_shutdown?id=${server_id}`
|
||||
}, async function(answer) {
|
||||
}, function(err) {
|
||||
//next(Error('session server not working'))
|
||||
})
|
||||
|
||||
module.exports.create_session = async (req, res, next) => {
|
||||
const create_session = async (req, res, next) => {
|
||||
//create?title=name&next_var=0
|
||||
try {
|
||||
var app_info
|
||||
@@ -54,6 +54,7 @@ module.exports.create_session = async (req, res, next) => {
|
||||
app_port = app_port_alloc.get()
|
||||
http_port = http_port_alloc.get()
|
||||
} catch(e) {
|
||||
//console.log('count error')
|
||||
throw new Error(e)
|
||||
}
|
||||
|
||||
@@ -85,9 +86,9 @@ module.exports.create_session = async (req, res, next) => {
|
||||
else {
|
||||
app_proc.kill('SIGINT')
|
||||
}
|
||||
http_client.get({
|
||||
host: coordinator_ip,
|
||||
port: coordinator_port,
|
||||
|
||||
http_client.gets({
|
||||
host: coordinator_domain,
|
||||
path: `/session/close?session_id=${req.query.session_id}`
|
||||
}, async function(answer) {
|
||||
}, function(err) {
|
||||
@@ -95,14 +96,22 @@ module.exports.create_session = async (req, res, next) => {
|
||||
})
|
||||
|
||||
})
|
||||
res.json({msg:'SESSION_CREATED', link:`http://${server_ip+':'+http_port}`})
|
||||
setTimeout(() => {
|
||||
res.json({msg:'SESSION_CREATED', link:`https://${external_domain}/${start_nginx}${http_port}/`})
|
||||
}, 1000)
|
||||
} catch (e) {
|
||||
next(e)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.connect_session = async (req, res, next) => {
|
||||
const connect_session = async (req, res, next) => {
|
||||
}
|
||||
|
||||
module.exports.close_session = async (req, res, next) => {
|
||||
const close_session = async (req, res, next) => {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
create_session,
|
||||
connect_session,
|
||||
close_session
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
[
|
||||
{
|
||||
"title":"mosharov",
|
||||
"title":"fortis",
|
||||
"path":"D:/shared/Builds/Fortis_UnStable_64/WindowsNoEditor/FORTIS_Taktika.exe"
|
||||
},
|
||||
{
|
||||
"title":"ivazowsky",
|
||||
"path":"D:/shared/Builds/Ivaz_Optimized_2/Ivazowsky.exe"
|
||||
},
|
||||
{
|
||||
"title":"mosharov",
|
||||
"path":"D:/shared/Builds/mosharForStreaming/Masharovdev.exe"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user