aboutsummaryrefslogtreecommitdiffstats
path: root/meet.lua
diff options
context:
space:
mode:
Diffstat (limited to 'meet.lua')
-rw-r--r--meet.lua46
1 files changed, 46 insertions, 0 deletions
diff --git a/meet.lua b/meet.lua
new file mode 100644
index 0000000..238a376
--- /dev/null
+++ b/meet.lua
@@ -0,0 +1,46 @@
+-- Copyright (c) 2021 Teddy Wing
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+
+meet_csrf = 'tRuEptc89Uu 1UdpeOl1SZWW8QjjVSj8cu9kv7di68YDGZH83gKdC3H725f xIo4MqFacxqInARWtTkhcmOWDLNL5bti6d22ZwqF'
+
+meet_server = hs.httpserver.new(false, false)
+meet_server:setInterface('loopback')
+meet_server:setPort(3337)
+meet_server:setCallback(function(method, path, headers, body)
+ response_headers = {}
+ response_headers['Access-Control-Allow-Origin'] = 'https://meet.google.com'
+ response_headers['Vary'] = 'Origin'
+
+ if headers['HS-Meet'] ~= meet_csrf then
+ return '', 403, response_headers
+ end
+
+ if method == 'POST' then
+ if path == '/volume-meet' then
+ wasSet = hs.audiodevice.defaultOutputDevice():setOutputVolume(38)
+
+ if not wasSet then
+ return '', 500, response_headers
+ end
+
+ return '', 200, response_headers
+ end
+ end
+
+ return '', 404, response_headers
+end)
+
+meet_server:start()