mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
useWebSocketImplementation() on relay.ts
This commit is contained in:
@@ -92,10 +92,11 @@ await relay.publish(signedEvent)
|
||||
relay.close()
|
||||
```
|
||||
|
||||
To use this on Node.js you first must install `websocket-polyfill` and import it:
|
||||
To use this on Node.js you first must install `ws` and call something like this:
|
||||
|
||||
```js
|
||||
import 'websocket-polyfill'
|
||||
import { useWebSocketImplementation } from 'nostr-tools/relay'
|
||||
useWebSocketImplementation(require('ws'))
|
||||
```
|
||||
|
||||
### Interacting with multiple relays
|
||||
|
||||
Reference in New Issue
Block a user