Skip to content

Commit

Permalink
chore: add examples of node usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed Sep 1, 2024
1 parent 2720a2e commit 4ad511a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ interface MessageListenerOptions {
```

```ts
startListen(652581, handler, {
ws: {
headers: {
Cookie: 'xxx',
},
uid: 0,
}
})

// or
startListen(652581, handler, {
ws: {
platform: 'web',
Expand Down
9 changes: 8 additions & 1 deletion example/node/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ const handler: MsgHandler = {
},
}

startListen(652581, handler)
startListen(652581, handler, {
ws: {
headers: {
Cookie: 'LIVE_BUVID=xxx; buvid3=xxx; xxx',
},
uid: 541993,
},
})
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ad511a

Please sign in to comment.