Fix debug option.
This commit is contained in:
parent
9a2da60b7d
commit
92f076d425
@ -149,7 +149,7 @@ function discover_websocket_s2s(event)
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
local f_ws_proxy = io.open(path.join(server_infos_dir, to_host, 'ws-proxy'), "r");
|
local f_ws_proxy = io.open(path.join(server_infos_dir, to_host, 'ws-s2s'), "r");
|
||||||
if f_ws_proxy == nil then
|
if f_ws_proxy == nil then
|
||||||
module:log("debug", "Remote host %s is not a known remote Peertube, we will let legacy s2s module handle the connection", to_host);
|
module:log("debug", "Remote host %s is not a known remote Peertube, we will let legacy s2s module handle the connection", to_host);
|
||||||
return;
|
return;
|
||||||
@ -159,18 +159,18 @@ function discover_websocket_s2s(event)
|
|||||||
|
|
||||||
local remote_ws_proxy_conf = json.decode(content);
|
local remote_ws_proxy_conf = json.decode(content);
|
||||||
if (not remote_ws_proxy_conf) then
|
if (not remote_ws_proxy_conf) then
|
||||||
module:log("error", "Remote host %s has empty ws-proxy configuration", to_host);
|
module:log("error", "Remote host %s has empty ws-s2s configuration", to_host);
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
if (not remote_ws_proxy_conf['url']) then
|
if (not remote_ws_proxy_conf['url']) then
|
||||||
module:log("error", "Remote host %s has missing Websocket url in ws-proxy configuration", to_host);
|
module:log("error", "Remote host %s has missing Websocket url in ws-s2s configuration", to_host);
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
module:log("debug", "Found a Websocket endpoint to proxify s2s communications to remote host %s", to_host);
|
module:log("debug", "Found a Websocket endpoint to proxify s2s communications to remote host %s", to_host);
|
||||||
local properties = {};
|
local properties = {};
|
||||||
properties["extra_headers"] = {
|
properties["extra_headers"] = {
|
||||||
["peertube-livechat-ws-proxy-instance-url"] = instance_url;
|
["peertube-livechat-ws-s2s-instance-url"] = instance_url;
|
||||||
};
|
};
|
||||||
properties["url"] = remote_ws_proxy_conf["url"];
|
properties["url"] = remote_ws_proxy_conf["url"];
|
||||||
return properties;
|
return properties;
|
||||||
@ -186,7 +186,7 @@ function discover_websocket_s2s(event)
|
|||||||
|
|
||||||
-- local ex = {};
|
-- local ex = {};
|
||||||
-- ex.headers = {
|
-- ex.headers = {
|
||||||
-- ["peertube-livechat-ws-proxy-instance-url"] = instance_url;
|
-- ["peertube-livechat-ws-s2s-instance-url"] = instance_url;
|
||||||
-- ["sec_websocket_protocol"] = 'xmpp';
|
-- ["sec_websocket_protocol"] = 'xmpp';
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ if what == 'debug' then
|
|||||||
local dir_sep = package.config:sub(1,1);
|
local dir_sep = package.config:sub(1,1);
|
||||||
package.path = package.path..lua_path_sep..mobdebug_path..dir_sep.."?.lua";
|
package.path = package.path..lua_path_sep..mobdebug_path..dir_sep.."?.lua";
|
||||||
require "mobdebug".start(mobdebug_host, mobdebug_port);
|
require "mobdebug".start(mobdebug_host, mobdebug_port);
|
||||||
|
require "mobdebug".coro();
|
||||||
what = table.remove(arg, 1);
|
what = table.remove(arg, 1);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user