Skip to content

Commit b548605

Browse files
committed
[core] delete bare-mux
1 parent 55c259b commit b548605

File tree

12 files changed

+383
-366
lines changed

12 files changed

+383
-366
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"typescript": "^5.8.3"
6262
},
6363
"dependencies": {
64-
"@mercuryworkshop/bare-mux": "^2.1.7",
64+
"@mercuryworkshop/epoxy-tls": "2.1.18-1",
6565
"dom-serializer": "^2.0.0",
6666
"domhandler": "^5.0.3",
6767
"domutils": "^3.2.2",

server.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { fileURLToPath } from "node:url";
1111
import { server as wisp } from "@mercuryworkshop/wisp-js/server";
1212

1313
//transports
14-
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
14+
// import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
1515
import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
1616
import { libcurlPath } from "@mercuryworkshop/libcurl-transport";
1717
import { bareModulePath } from "@mercuryworkshop/bare-as-module3";
@@ -62,11 +62,11 @@ fastify.register(fastifyStatic, {
6262
prefix: "/assets/",
6363
decorateReply: false,
6464
});
65-
fastify.register(fastifyStatic, {
66-
root: baremuxPath,
67-
prefix: "/baremux/",
68-
decorateReply: false,
69-
});
65+
// fastify.register(fastifyStatic, {
66+
// root: baremuxPath,
67+
// prefix: "/baremux/",
68+
// decorateReply: false,
69+
// });
7070
fastify.register(fastifyStatic, {
7171
root: epoxyPath,
7272
prefix: "/epoxy/",

src/client/index.ts

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { ScramjetFrame } from "@/controller/frame";
2+
import initEpoxy, {
3+
EpoxyClient,
4+
EpoxyClientOptions,
5+
EpoxyHandlers,
6+
info as epoxyInfo,
7+
} from "@mercuryworkshop/epoxy-tls";
28
import { SCRAMJETCLIENT, SCRAMJETFRAME } from "@/symbols";
39
import { createDocumentProxy } from "@client/document";
410
import { createGlobalProxy } from "@client/global";
511
import { getOwnPropertyDescriptorHandler } from "@client/helpers";
612
import { createLocationProxy } from "@client/location";
713
import { nativeGetOwnPropertyDescriptor } from "@client/natives";
8-
import {
9-
BareClient,
10-
type BareClient as BareClientType,
11-
} from "@mercuryworkshop/bare-mux";
1214
import { createWrapFn } from "@client/shared/wrap";
1315
import { NavigateEvent } from "@client/events";
1416
import { rewriteUrl, unrewriteUrl, type URLMeta } from "@rewriters/url";
@@ -72,7 +74,7 @@ export class ScramjetClient {
7274
globalProxy: any;
7375
locationProxy: any;
7476
serviceWorker: ServiceWorkerContainer;
75-
bare: BareClientType;
77+
epoxy: EpoxyClient;
7678

7779
natives: NativeStore;
7880
descriptors: DescriptorStore;
@@ -102,22 +104,29 @@ export class ScramjetClient {
102104
throw new Error();
103105
}
104106

107+
initEpoxy().then(() => {
108+
let options = new EpoxyClientOptions();
109+
options.user_agent = navigator.userAgent;
110+
this.epoxy = new EpoxyClient(config.wisp, options);
111+
});
112+
105113
if (iswindow) {
106-
this.bare = new BareClient();
114+
// this.bare = new EpoxyClient();
115+
// this.bare = new BareClient();
107116
} else {
108-
this.bare = new BareClient(
109-
new Promise((resolve) => {
110-
addEventListener("message", ({ data }) => {
111-
if (typeof data !== "object") return;
112-
if (
113-
"$scramjet$type" in data &&
114-
data.$scramjet$type === "baremuxinit"
115-
) {
116-
resolve(data.port);
117-
}
118-
});
119-
})
120-
);
117+
// this.bare = new BareClient(
118+
// new Promise((resolve) => {
119+
// addEventListener("message", ({ data }) => {
120+
// if (typeof data !== "object") return;
121+
// if (
122+
// "$scramjet$type" in data &&
123+
// data.$scramjet$type === "baremuxinit"
124+
// ) {
125+
// resolve(data.port);
126+
// }
127+
// });
128+
// })
129+
// );
121130
}
122131

123132
this.serviceWorker = this.global.navigator.serviceWorker;

0 commit comments

Comments
 (0)