mirror of
https://github.com/MercuryWorkshop/bare-mux.git
synced 2025-05-16 07:30:01 -04:00
update readme
This commit is contained in:
parent
d9b3ffe51d
commit
228ddac643
1 changed files with 5 additions and 2 deletions
|
@ -42,13 +42,16 @@ Here is an example of using bare-mux:
|
|||
/// As an end-user
|
||||
import { BareMuxConnection } from "@mercuryworkshop/bare-mux";
|
||||
const conn = new BareMuxConnection("/bare-mux/worker.js");
|
||||
|
||||
// Set Bare-Client transport
|
||||
// If your transport is an ES module and exports the class as the default export
|
||||
await conn.setTransport("/bare-mux/transport-module.js", ["arg1", "ws://localhost:4000"]);
|
||||
|
||||
// Set Transport Manually
|
||||
await conn.setManualTransport(`
|
||||
const exports = await import("/bare-mux/transport.js");
|
||||
return new exports.BareClient("https://tomp.app");
|
||||
`);
|
||||
// If your transport is an ES module and exports the class as the default export
|
||||
await conn.setTransport("/bare-mux/transport-module.js", ["arg1", "ws://localhost:4000"]);
|
||||
|
||||
/// As a proxy developer
|
||||
import { BareClient } from "@mercuryworkshop/bare-mux";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue