Skip to content

Commit

Permalink
feat: update collabWebSocketUrl link
Browse files Browse the repository at this point in the history
  • Loading branch information
hexf00 committed Oct 19, 2024
1 parent 1635af6 commit ba2cc50
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/setup-univer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export function setupUniver() {

// if univer page is not in the same domain as the server, you need to set the following parameters
const universerEndpoint = window.location.host
const isSecure = window.location.protocol === 'https:'

// need equal to the container id, history viewer will use this id to find the container
configService.setConfig('UNIVER_CONTAINER_ID', `univer`)
Expand All @@ -141,10 +142,10 @@ export function setupUniver() {
univer.registerPlugin(UniverCollaborationPlugin)
univer.registerPlugin(UniverCollaborationClientPlugin, {
// if univer page is not in the same domain as the server, you need to set the following parameters
// authzUrl: `http://${universerEndpoint}/universer-api/authz`,
// snapshotServerUrl: `http://${universerEndpoint}/universer-api/snapshot`,
// collabSubmitChangesetUrl: `http://${universerEndpoint}/universer-api/comb`,
// collabWebSocketUrl: `ws://${universerEndpoint}/universer-api/comb/connect`,
// authzUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/authz`,
// snapshotServerUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/snapshot`,
// collabSubmitChangesetUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/comb`,
collabWebSocketUrl: `${isSecure ? 'wss' : 'ws'}://${universerEndpoint}/universer-api/comb/connect`,
sendChangesetTimeout: 200,
})

Expand All @@ -171,11 +172,11 @@ export function setupUniver() {
// exchange
univer.registerPlugin(UniverExchangeClientPlugin, {
// if univer page is not in the same domain as the server, you need to set the following parameters
// uploadFileServerUrl: `http://${universerEndpoint}/universer-api/stream/file/upload`,
// importServerUrl: `http://${universerEndpoint}/universer-api/exchange/{type}/import`,
// exportServerUrl: `http://${universerEndpoint}/universer-api/exchange/{type}/export`,
// getTaskServerUrl: `http://${universerEndpoint}/universer-api/exchange/task/{taskID}`,
// signUrlServerUrl: `http://${universerEndpoint}/universer-api/file/{fileID}/sign-url`,
// uploadFileServerUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/stream/file/upload`,
// importServerUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/exchange/{type}/import`,
// exportServerUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/exchange/{type}/export`,
// getTaskServerUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/exchange/task/{taskID}`,
// signUrlServerUrl: `${isSecure ? 'https' : 'http'}://${universerEndpoint}/universer-api/file/{fileID}/sign-url`,
maxTimeoutTime: 24 * 60 * 60 * 1000, // 24h
})
univer.registerPlugin(UniverSheetsExchangeClientPlugin)
Expand Down

0 comments on commit ba2cc50

Please sign in to comment.