Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files- public/index.html +5 -2
- public/index.js +1 -1
- public/sw.js +1 -1
- server.js +1 -1
public/index.html
CHANGED
|
@@ -1,15 +1,17 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="ja">
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Shadow Proxy</title>
|
| 7 |
<link rel="stylesheet" href="style.css">
|
| 8 |
-
<script src="/baremux/
|
| 9 |
<script src="/uv/uv.bundle.js" defer></script>
|
| 10 |
<script src="/uv/uv.config.js" defer></script>
|
| 11 |
<script src="/index.js" defer></script>
|
| 12 |
</head>
|
|
|
|
| 13 |
<body>
|
| 14 |
<div class="container">
|
| 15 |
<h1>Shadow Proxy</h1>
|
|
@@ -20,4 +22,5 @@
|
|
| 20 |
</form>
|
| 21 |
</div>
|
| 22 |
</body>
|
| 23 |
-
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="ja">
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
<title>Shadow Proxy</title>
|
| 8 |
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<script src="/baremux/index.js" defer></script>
|
| 10 |
<script src="/uv/uv.bundle.js" defer></script>
|
| 11 |
<script src="/uv/uv.config.js" defer></script>
|
| 12 |
<script src="/index.js" defer></script>
|
| 13 |
</head>
|
| 14 |
+
|
| 15 |
<body>
|
| 16 |
<div class="container">
|
| 17 |
<h1>Shadow Proxy</h1>
|
|
|
|
| 22 |
</form>
|
| 23 |
</div>
|
| 24 |
</body>
|
| 25 |
+
|
| 26 |
+
</html>
|
public/index.js
CHANGED
|
@@ -25,7 +25,7 @@ form.addEventListener('submit', async (e) => {
|
|
| 25 |
// bare-muxγη¨γγ¦ιδΏ‘γ―γ©γ€γ’γ³γγγ»γγγ’γγγγΎγ
|
| 26 |
try {
|
| 27 |
const connection = new BareMux.BareMuxConnection("/baremux/worker.js");
|
| 28 |
-
await connection.setTransport("/baremux/
|
| 29 |
} catch (e) {
|
| 30 |
console.log("BareMux init info:", e);
|
| 31 |
}
|
|
|
|
| 25 |
// bare-muxγη¨γγ¦ιδΏ‘γ―γ©γ€γ’γ³γγγ»γγγ’γγγγΎγ
|
| 26 |
try {
|
| 27 |
const connection = new BareMux.BareMuxConnection("/baremux/worker.js");
|
| 28 |
+
await connection.setTransport("/baremux/index.mjs", [{ maintainer: '@tomphttp' }]);
|
| 29 |
} catch (e) {
|
| 30 |
console.log("BareMux init info:", e);
|
| 31 |
}
|
public/sw.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
importScripts('/uv/uv.bundle.js');
|
| 3 |
importScripts('/uv/uv.config.js');
|
| 4 |
importScripts('/uv/uv.sw.js');
|
|
|
|
| 1 |
+
// bare-mux doesn't need to be imported in the UV sw directly. It's used by the client.
|
| 2 |
importScripts('/uv/uv.bundle.js');
|
| 3 |
importScripts('/uv/uv.config.js');
|
| 4 |
importScripts('/uv/uv.sw.js');
|
server.js
CHANGED
|
@@ -13,7 +13,7 @@ const app = express();
|
|
| 13 |
|
| 14 |
app.use(express.static(join(__dirname, 'public')));
|
| 15 |
app.use('/uv/', express.static(uvPath));
|
| 16 |
-
app.use('/baremux/', express.static(
|
| 17 |
|
| 18 |
app.use((req, res) => {
|
| 19 |
res.status(404).sendFile(join(__dirname, 'public', 'index.html'));
|
|
|
|
| 13 |
|
| 14 |
app.use(express.static(join(__dirname, 'public')));
|
| 15 |
app.use('/uv/', express.static(uvPath));
|
| 16 |
+
app.use('/baremux/', express.static(join(__dirname, 'node_modules', '@mercuryworkshop', 'bare-mux', 'dist')));
|
| 17 |
|
| 18 |
app.use((req, res) => {
|
| 19 |
res.status(404).sendFile(join(__dirname, 'public', 'index.html'));
|