snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
31
resources/prosody-plugins/mod_turncredentials_http.lua
Normal file
31
resources/prosody-plugins/mod_turncredentials_http.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
-- http endpoint to expose turn credentials for other services
|
||||
-- Copyright (C) 2023-present 8x8, Inc.
|
||||
|
||||
local ext_services = module:depends("external_services");
|
||||
local get_services = ext_services.get_services;
|
||||
|
||||
local async_handler_wrapper = module:require "util".async_handler_wrapper;
|
||||
local json = require 'cjson.safe';
|
||||
|
||||
--- Handles request for retrieving turn credentials
|
||||
-- @param event the http event, holds the request query
|
||||
-- @return GET response, containing a json with participants details
|
||||
function handle_get_turn_credentials (event)
|
||||
local GET_response = {
|
||||
headers = {
|
||||
content_type = "application/json";
|
||||
};
|
||||
body = json.encode(get_services());
|
||||
};
|
||||
return GET_response;
|
||||
end;
|
||||
|
||||
function module.load()
|
||||
module:depends("http");
|
||||
module:provides("http", {
|
||||
default_path = "/";
|
||||
route = {
|
||||
["GET turn-credentials"] = function (event) return async_handler_wrapper(event,handle_get_turn_credentials) end;
|
||||
};
|
||||
});
|
||||
end
|
||||
Reference in New Issue
Block a user