Skip to content

Commit

Permalink
Fixed library for nodejs Webrtc Client
Browse files Browse the repository at this point in the history
I am exploring a system where I would like to use Webrtc on both the
browser clients and the server.

I expect to have a small number of servers that will interact with the
system just like any other client, only they will have slightly better
uptime and persistence capabilities.

Unfortunately, the y-webrtc library loads the browser only build of
simple-peer, and this causes a failure when run inside of a node
application.

This change does not work (as-is) when used to build for the browser
(using esbuild) because simple-peer requires nodejs events module, which
esbuild doesn't want to put into the browser.

Because it breaks the browser case, please do not pull this change
upstream.
  • Loading branch information
lukebayes committed May 7, 2022
1 parent f0b9298 commit c2b06c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/y-webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import * as math from 'lib0/math'
import { createMutex } from 'lib0/mutex'

import * as Y from 'yjs' // eslint-disable-line
import Peer from 'simple-peer/simplepeer.min.js'
import Peer from 'simple-peer'

import * as syncProtocol from 'y-protocols/sync'
import * as awarenessProtocol from 'y-protocols/awareness'
Expand Down

0 comments on commit c2b06c7

Please sign in to comment.