Skip to content

Commit 77b95c4

Browse files
committed
feat: add custom-router example
1 parent 8d4176a commit 77b95c4

File tree

7 files changed

+5060
-3
lines changed

7 files changed

+5060
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
RUSTFLAGS: -Dwarnings
1414
RUSTDOCFLAGS: -Dwarnings
1515
MSRV: "1.81"
16-
RS_EXAMPLES_LIST: "dumbpipe-web,extism/host,extism/iroh-extism-host-functions,extism/plugin,iroh-automerge,iroh-automerge-repo,iroh-gateway,frosty,browser-echo,framed-messages"
16+
RS_EXAMPLES_LIST: "dumbpipe-web,extism/host,extism/iroh-extism-host-functions,extism/plugin,iroh-automerge,iroh-automerge-repo,iroh-gateway,frosty,browser-echo,framed-messages,custom-router"
1717
WASM_EXAMPLES_LIST: "browser-echo"
1818
IROH_FORCE_STAGING_RELAYS: "1"
1919

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ Use iroh in the browser, compiled to web assembly. [Try it here!](https://n0-com
1616
A chat app based on iroh-gossip that can run both in the browser and on the command line.
1717
[Try it here!](https://n0-computer.github.io/iroh-examples/main/browser-chat/index.html)
1818

19+
### [custom-router](custom-router)
20+
21+
When you need more control or customizations than the
22+
[iroh `Router`](https://docs.rs/iroh/latest/iroh/protocol/struct.Router.html) allows, we
23+
recommend to build your own router instead. This example implements a router that allows
24+
to add and remove protocols at runtime.
25+
1926
### [dumbpipe-web](dumbpipe-web)
2027

2128
Forward http requests to dumbpipe. Share a local dev server publicly.

browser-chat/frontend/src/components/invitepopup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function InviteButton({ channel, getTicket }: InvitePopupProps) {
5050
<AdaptiveDialogHeader>
5151
<AdaptiveDialogTitle>Invite peers</AdaptiveDialogTitle>
5252
</AdaptiveDialogHeader>
53-
<div className="grow-0 mt-2 max-h-[60vh] max-w-2xl overflow-auto">
53+
<div className="grow-0 mt-2 max-h-[60vh] max-w-2xl overflow-auto p-4">
5454
<InvitePopupContent channel={channel} getTicket={getTicket} />
5555
</div>
5656
</div>
@@ -81,7 +81,7 @@ export function InvitePopupContent({ channel, getTicket }: InvitePopupProps) {
8181

8282
return (
8383
<>
84-
<div className="mb-4">
84+
<div className="mb-4 p">
8585
<p className="font-semibold mb-2">Ticket</p>
8686
<div className="flex items-center">
8787
<span className="mr-2 font-mono">{ticket.substring(0, 16)}...</span>

0 commit comments

Comments
 (0)