@@ -17,9 +17,7 @@ import { Logger } from '@shared/utils/logger'
1717import { WebConfiguration } from '@/types/web-configuration'
1818import { ConfigWebConfigurationFormat } from '@/utils/web-configuration-format-converters'
1919import { LAST_SELECTED_BROWSER_ID_STATE_KEY } from '@/constants/state-keys'
20- import { ApplyResponseArgs } from '@/features/apply-response/response-processor'
2120import { t } from '@/i18n'
22- import { get_or_create_shared_token } from '../utils/shared-token'
2321
2422/**
2523 * Bridges the current workspace window and a WebSockets server
@@ -128,11 +126,7 @@ export class WebSocketManager {
128126 return new Promise ( ( resolve , reject ) => {
129127 let attempts = 0
130128 const challenge = crypto . randomBytes ( 16 ) . toString ( 'hex' )
131- const token = get_or_create_shared_token ( )
132- const expected_signature = crypto
133- . createHmac ( 'sha256' , token )
134- . update ( challenge )
135- . digest ( 'hex' )
129+ const expected_signature = challenge
136130
137131 const check = ( ) => {
138132 const req = http . get (
@@ -189,33 +183,31 @@ export class WebSocketManager {
189183
190184 const is_wsl = vscode . env . remoteName === 'wsl'
191185
192- if ( ! is_wsl ) {
193- const port_in_use = await this . _is_port_in_use ( this . port )
194- if ( ! port_in_use ) {
195- try {
196- await this . _start_server_process ( )
197- } catch ( error ) {
198- Logger . error ( {
199- function_name : '_connect_as_client' ,
200- message : 'Failed to restart WebSocket server' ,
201- data : error
202- } )
203- this . _schedule_reconnect ( )
204- return
205- }
206- } else {
207- // If the port was already in use, verify it's our server before connecting
208- try {
209- await this . _wait_for_server_ready ( 1 , 0 )
210- } catch ( error ) {
211- Logger . error ( {
212- function_name : '_connect_as_client' ,
213- message : 'Existing server on port failed ownership verification' ,
214- data : error
215- } )
216- this . _schedule_reconnect ( )
217- return
218- }
186+ const port_in_use = await this . _is_port_in_use ( this . port )
187+ if ( ! port_in_use ) {
188+ try {
189+ await this . _start_server_process ( )
190+ } catch ( error ) {
191+ Logger . error ( {
192+ function_name : '_connect_as_client' ,
193+ message : 'Failed to restart WebSocket server' ,
194+ data : error
195+ } )
196+ this . _schedule_reconnect ( )
197+ return
198+ }
199+ } else {
200+ // If the port was already in use, verify it's our server before connecting
201+ try {
202+ await this . _wait_for_server_ready ( 1 , 0 )
203+ } catch ( error ) {
204+ Logger . error ( {
205+ function_name : '_connect_as_client' ,
206+ message : 'Existing server on port failed ownership verification' ,
207+ data : error
208+ } )
209+ this . _schedule_reconnect ( )
210+ return
219211 }
220212 }
221213
@@ -239,11 +231,8 @@ export class WebSocketManager {
239231 }
240232 }
241233
242- const token = get_or_create_shared_token ( )
243234 const ws_url = `ws://localhost:${ this . port } ?client_type=${ CLIENT_TYPE . EDITOR } `
244- this . client = new WebSocket . WebSocket ( ws_url , {
245- headers : { Authorization : `Bearer ${ token } ` }
246- } )
235+ this . client = new WebSocket . WebSocket ( ws_url )
247236
248237 this . client . on ( 'open' , ( ) => {
249238 Logger . info ( {
0 commit comments