You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filepizza/client/peer.js

17 lines
295 B
JavaScript

import uuid from 'node-uuid'
const id = uuid.v4()
if (typeof window === 'undefined') {
var peer = { id: id }
} else {
let Peer = require('peerjs')
var peer = new Peer(id, {
host: window.location.hostname,
port: window.location.port,
path: '/peer'
})
}
export default peer