diff --git a/lua/gmod_integration/server/sv__websocket.lua b/lua/gmod_integration/server/sv__websocket.lua index 5efeb11..d0005b4 100644 --- a/lua/gmod_integration/server/sv__websocket.lua +++ b/lua/gmod_integration/server/sv__websocket.lua @@ -29,7 +29,15 @@ if (!GWSockets) then return end -local socket = GWSockets.createWebSocket("wss://ws.gmod-integration.com") +local function getWebSocketURL() + local url = "wss://ws.gmod-integration.com" + if (gmInte.config.debug && gmInte.config.wssDebug) then + url = gmInte.config.wssDebug + end + return url +end + +local socket = GWSockets.createWebSocket(getWebSocketURL()) // Authentication socket:setHeader("id", gmInte.config.id) diff --git a/lua/gmod_integration/shared/sh_http.lua b/lua/gmod_integration/shared/sh_http.lua index e435d24..9397491 100644 --- a/lua/gmod_integration/shared/sh_http.lua +++ b/lua/gmod_integration/shared/sh_http.lua @@ -25,6 +25,14 @@ local function errorMessage(body, code) end end +local function getAPIURL() + local url = "https://api.gmod-integration.com" + if (gmInte.config.debug && gmInte.config.apiDebug) then + url = gmInte.config.apiDebug + end + return url +end + local function sendHTTP(params) // Log the HTTP request gmInte.log("HTTP Request: " .. params.method .. " " .. params.endpoint, true) @@ -32,7 +40,7 @@ local function sendHTTP(params) // Send the HTTP request HTTP({ - url = "https://api.gmod-integration.com" .. params.endpoint, + url = getAPIURL() .. params.endpoint, method = params.method, headers = { ["Content-Type"] = "application/json",