Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.

Commit 33792ea

Browse files
committed
Enable HTTP for overlay
1 parent 8041af9 commit 33792ea

4 files changed

Lines changed: 20 additions & 12 deletions

File tree

readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ In order to build this application, you need to do the following:
115115
this application supports multiple flags that can be set via environment variables:
116116
- SPY=1 disables internal functionality and just displays requests and respones to original KUVO
117117
- LOG=1 enables request logging
118-
- UNSAFE=1 disables https and falls back to http. this will not work with Rekordbox, but might help debugging ssl related stuff
119118
- RENEW=1 recreates all certificates (cannot be undone, you need to install the new root certificate)
120119

121120
# Roadmap:

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const HOST = "localhost";
2-
export const WEB_PORT = 443;
3-
export const PROXY_PORT = 8080;
2+
export const HTTP_PORT = 80;
3+
export const HTTPS_PORT = 443;
44
export const PROXY_DOMAINS = [
55
'kuvo.com',
66
'*.kuvo.com',

src/server/webserver.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import http from 'http'
22
import https from 'https'
33
import ws from 'ws'
44

5-
import { HOST, WEB_PORT } from '../config'
5+
import { HOST, HTTPS_PORT, HTTP_PORT } from '../config'
66
import { createOrLoadKeys } from './encryption'
77
import { requestHandler } from './webhandler'
88
import { setupSystem } from './system-setup'
@@ -21,15 +21,19 @@ const setupWebserver = () => {
2121
setupSystem().then(() => {
2222
return createOrLoadKeys()
2323
}).then((certificates) => {
24-
const encrypted = process.env.UNSAFE !== '1'
25-
const webserver = !encrypted ? http.createServer(requestHandler) : https.createServer({
24+
25+
const webserver = http.createServer(requestHandler);
26+
27+
const secureWebserver = https.createServer({
2628
key: certificates.key,
2729
cert: certificates.cert,
28-
2930
}, requestHandler)
30-
31-
webserver.listen(WEB_PORT, () => {
32-
console.log(`WebServer is running on ${encrypted ? 'https' : 'http'}://${HOST}:${WEB_PORT}`);
31+
32+
secureWebserver.listen(HTTPS_PORT, () => {
33+
console.log(`SecureWebServer is running on https://${HOST}:${HTTPS_PORT}`);
34+
})
35+
webserver.listen(HTTP_PORT, () => {
36+
console.log(`WebServer is running on http://${HOST}:${HTTP_PORT}`);
3337
})
3438

3539
const wsServer = new ws.Server({noServer: true});
@@ -46,6 +50,11 @@ const setupWebserver = () => {
4650
socket.send(lastMessage)
4751
})
4852

53+
secureWebserver.on('upgrade', (request, socket, head) => {
54+
wsServer.handleUpgrade(request, socket, head, (s) => {
55+
wsServer.emit('connection', s, request)
56+
})
57+
})
4958
webserver.on('upgrade', (request, socket, head) => {
5059
wsServer.handleUpgrade(request, socket, head, (s) => {
5160
wsServer.emit('connection', s, request)

src/ui/settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useState } from 'react';
22
import { ipcRenderer } from 'electron';
33

4-
import { HOST, WEB_PORT } from '../config';
4+
import { HOST } from '../config';
55
import { CertificateStore } from '../types/certificate';
66

77
import download from './helpers/download';
@@ -149,7 +149,7 @@ const SettingsView: React.FC<{}> = () => {
149149
<br />
150150
<img src="/static/overlay.png" />
151151
</p>
152-
<input readOnly value="https://localhost/overlay" />
152+
<input readOnly value="http://localhost/overlay" />
153153
</div>
154154
</div>
155155
);

0 commit comments

Comments
 (0)