Skip to content

Commit

Permalink
prefer public ws server
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Jan 15, 2024
1 parent 45043a5 commit 9ad2b00
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions codemirror.next/codemirror.next.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const userColor = usercolors[random.uint32() % usercolors.length]
const ydoc = new Y.Doc()
// const provider = new WebrtcProvider('codemirror6-demo-room', ydoc)
const provider = new WebsocketProvider(
`ws${location.protocol.slice(4)}//${location.host}/ws`, // use the local ws server
// 'wss://demos.yjs.dev/ws', // alternatively use the public ws server
'wss://demos.yjs.dev/ws', // use the public ws server
// `ws${location.protocol.slice(4)}//${location.host}/ws`, // alternatively: use the local ws server (run `npm start` in root directory)
'codemirror.next-demo',
ydoc
)
Expand Down
4 changes: 2 additions & 2 deletions codemirror/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import 'codemirror/mode/javascript/javascript.js'
window.addEventListener('load', () => {
const ydoc = new Y.Doc()
const provider = new WebsocketProvider(
`ws${location.protocol.slice(4)}//${location.host}/ws`, // use the local ws server
// 'wss://demos.yjs.dev/ws', // alternatively use the public ws server
'wss://demos.yjs.dev/ws', // use the public ws server
// `ws${location.protocol.slice(4)}//${location.host}/ws`, // alternatively: use the local ws server (run `npm start` in root directory)
'codemirror-demo',
ydoc
)
Expand Down
4 changes: 2 additions & 2 deletions monaco/monaco.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import * as monaco from 'monaco-editor'
window.addEventListener('load', () => {
const ydoc = new Y.Doc()
const provider = new WebsocketProvider(
`ws${location.protocol.slice(4)}//${location.host}/ws`, // use the local ws server
// 'wss://demos.yjs.dev/ws', // alternatively use the public ws server
'wss://demos.yjs.dev/ws', // use the public ws server
// `ws${location.protocol.slice(4)}//${location.host}/ws`, // alternatively: use the local ws server (run `npm start` in root directory)
'monaco-demo',
ydoc
)
Expand Down
4 changes: 2 additions & 2 deletions prosemirror-versions/prosemirror-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ window.addEventListener('load', () => {
permanentUserData.setUserMapping(ydoc, ydoc.clientID, user.username)
ydoc.gc = false
const provider = new WebsocketProvider(
`ws${location.protocol.slice(4)}//${location.host}/ws`, // use the local ws server
// 'wss://demos.yjs.dev/ws', // alternatively use the public ws server
'wss://demos.yjs.dev/ws', // use the public ws server
// `ws${location.protocol.slice(4)}//${location.host}/ws`, // alternatively: use the local ws server (run `npm start` in root directory)
'prosemirror-versions-demo',
ydoc
)
Expand Down
4 changes: 2 additions & 2 deletions prosemirror/prosemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { keymap } from 'prosemirror-keymap'
window.addEventListener('load', () => {
const ydoc = new Y.Doc()
const provider = new WebsocketProvider(
`ws${location.protocol.slice(4)}//${location.host}/ws`, // use the local ws server
// 'wss://demos.yjs.dev/ws', // alternatively use the public ws server
'wss://demos.yjs.dev/ws', // use the public ws server
// `ws${location.protocol.slice(4)}//${location.host}/ws`, // alternatively: use the local ws server (run `npm start` in root directory)
'prosemirror-demo',
ydoc
)
Expand Down
4 changes: 2 additions & 2 deletions quill/quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Quill.register('modules/cursors', QuillCursors)
window.addEventListener('load', () => {
const ydoc = new Y.Doc()
const provider = new WebsocketProvider(
`ws${location.protocol.slice(4)}//${location.host}/ws`, // use the local ws server
// 'wss://demos.yjs.dev/ws', // alternatively use the public ws server
'wss://demos.yjs.dev/ws', // use the public ws server
// `ws${location.protocol.slice(4)}//${location.host}/ws`, // alternatively: use the local ws server (run `npm start` in root directory)
'quill-demo-5',
ydoc
)
Expand Down

0 comments on commit 9ad2b00

Please sign in to comment.