Skip to content

Commit d259132

Browse files
committed
Consolidate websocket constants into shared package and fix SECURITY_TOKENS.BROWSER reference
- move default port and security tokens to shared constants
1 parent 08468ae commit d259132

4 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/browser/src/background/websocket.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const connect_websocket = async (): Promise<void> => {
7676
storage['browser-profile-name'] as string | undefined
7777
)?.trim()
7878

79-
let ws_url = `ws://localhost:${DEFAULT_PORT}?token=${SECURITY_TOKENS.BROWSERS}&version=${version}&user_agent=${encodeURIComponent(user_agent)}`
79+
let ws_url = `ws://localhost:${DEFAULT_PORT}?token=${SECURITY_TOKENS.BROWSER}&version=${version}&user_agent=${encodeURIComponent(user_agent)}`
8080
if (profile_name) {
8181
ws_url += `&profile_name=${encodeURIComponent(profile_name)}`
8282
}

‎apps/editor/src/services/websocket-manager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
WebSocketMessage
1212
} from '@shared/types/websocket-message'
1313
import { CHATBOTS } from '@shared/constants/chatbots'
14-
import { DEFAULT_PORT, SECURITY_TOKENS } from '@/constants/websocket'
14+
import { DEFAULT_PORT, SECURITY_TOKENS } from '@shared/constants/websocket'
1515
import { Logger } from '@shared/utils/logger'
1616
import { WebConfiguration } from '@shared/types/web-configuration'
1717
import { ConfigWebConfigurationFormat } from '@/utils/web-configuration-format-converters'

‎apps/editor/src/services/websocket-server-process.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as process from 'process'
33
// eslint-disable-next-line @typescript-eslint/no-var-requires
44
const WebSocket = require('ws')
55

6-
import { DEFAULT_PORT, SECURITY_TOKENS } from '../constants/websocket'
6+
import { DEFAULT_PORT, SECURITY_TOKENS } from '@shared/constants/websocket'
77

88
interface BrowserClient {
99
ws: WebSocket
File renamed without changes.

0 commit comments

Comments
 (0)