@@ -21,14 +21,14 @@ export class AppDebugSocketProxyFactory
2121 private $lockService : ILockService ,
2222 private $options : IOptions ,
2323 private $tempService : ITempService ,
24- private $net : INet
24+ private $net : INet ,
2525 ) {
2626 super ( ) ;
2727 }
2828
2929 public getTCPSocketProxy (
3030 deviceIdentifier : string ,
31- appId : string
31+ appId : string ,
3232 ) : net . Server {
3333 return this . deviceTcpServers [ `${ deviceIdentifier } -${ appId } ` ] ;
3434 }
@@ -37,18 +37,18 @@ export class AppDebugSocketProxyFactory
3737 device : Mobile . IiOSDevice ,
3838 appId : string ,
3939 projectName : string ,
40- projectDir : string
40+ projectDir : string ,
4141 ) : Promise < net . Server > {
4242 const cacheKey = `${ device . deviceInfo . identifier } -${ appId } ` ;
4343 const existingServer = this . deviceTcpServers [ cacheKey ] ;
4444 if ( existingServer ) {
4545 this . $errors . fail (
46- `TCP socket proxy is already running for device '${ device . deviceInfo . identifier } ' and app '${ appId } '`
46+ `TCP socket proxy is already running for device '${ device . deviceInfo . identifier } ' and app '${ appId } '` ,
4747 ) ;
4848 }
4949
5050 this . $logger . info (
51- "\nSetting up proxy...\nPress Ctrl + C to terminate, or disconnect.\n"
51+ "\nSetting up proxy...\nPress Ctrl + C to terminate, or disconnect.\n" ,
5252 ) ;
5353
5454 const server = net . createServer ( {
@@ -69,7 +69,7 @@ export class AppDebugSocketProxyFactory
6969 const appDebugSocket = await device . getDebugSocket (
7070 appId ,
7171 projectName ,
72- projectDir
72+ projectDir ,
7373 ) ;
7474 this . $logger . info ( "Backend socket created." ) ;
7575
@@ -112,7 +112,7 @@ export class AppDebugSocketProxyFactory
112112 device : Mobile . IiOSDevice ,
113113 appId : string ,
114114 projectName : string ,
115- projectDir : string
115+ projectDir : string ,
116116 ) : Promise < ws . Server > {
117117 const existingWebProxy =
118118 this . deviceWebServers [ `${ device . deviceInfo . identifier } -${ appId } ` ] ;
@@ -130,22 +130,22 @@ export class AppDebugSocketProxyFactory
130130 device : Mobile . IiOSDevice ,
131131 appId : string ,
132132 projectName : string ,
133- projectDir : string
133+ projectDir : string ,
134134 ) : Promise < ws . Server > {
135135 let clientConnectionLockRelease : ( ) => void ;
136136 const cacheKey = `${ device . deviceInfo . identifier } -${ appId } ` ;
137137 const existingServer = this . deviceWebServers [ cacheKey ] ;
138138 if ( existingServer ) {
139139 this . $errors . fail (
140- `Web socket proxy is already running for device '${ device . deviceInfo . identifier } ' and app '${ appId } '`
140+ `Web socket proxy is already running for device '${ device . deviceInfo . identifier } ' and app '${ appId } '` ,
141141 ) ;
142142 }
143143
144144 // NOTE: We will try to provide command line options to select ports, at least on the localhost.
145145 const localPort = await this . $net . getAvailablePortInRange ( 41000 ) ;
146146
147147 this . $logger . info (
148- "\nSetting up debugger proxy...\nPress Ctrl + C to terminate, or disconnect.\n"
148+ "\nSetting up debugger proxy...\nPress Ctrl + C to terminate, or disconnect.\n" ,
149149 ) ;
150150
151151 // NB: When the inspector frontend connects we might not have connected to the inspector backend yet.
@@ -159,14 +159,14 @@ export class AppDebugSocketProxyFactory
159159 port : localPort ,
160160 verifyClient : async (
161161 info : any ,
162- callback : ( res : boolean , code ?: number , message ?: string ) => void
162+ callback : ( res : boolean , code ?: number , message ?: string ) => void ,
163163 ) => {
164164 let acceptHandshake = true ;
165165 clientConnectionLockRelease = null ;
166166
167167 try {
168168 clientConnectionLockRelease = await this . $lockService . lock (
169- `debug-connection-${ device . deviceInfo . identifier } -${ appId } .lock`
169+ `debug-connection-${ device . deviceInfo . identifier } -${ appId } .lock` ,
170170 ) ;
171171
172172 this . $logger . info ( "Frontend client connected." ) ;
@@ -184,7 +184,7 @@ export class AppDebugSocketProxyFactory
184184 appDebugSocket = await device . getDebugSocket (
185185 appId ,
186186 projectName ,
187- projectDir
187+ projectDir ,
188188 ) ;
189189 currentAppSocket = appDebugSocket ;
190190 this . $logger . info ( "Backend socket created." ) ;
@@ -198,7 +198,7 @@ export class AppDebugSocketProxyFactory
198198 this . emit ( CONNECTION_ERROR_EVENT_NAME , err ) ;
199199 acceptHandshake = false ;
200200 this . $logger . warn (
201- `Cannot connect to device socket. The error message is '${ err . message } '.`
201+ `Cannot connect to device socket. The error message is '${ err . message } '.` ,
202202 ) ;
203203 }
204204
@@ -225,7 +225,7 @@ export class AppDebugSocketProxyFactory
225225 webSocket . send ( message ) ;
226226 } else {
227227 this . $logger . trace (
228- `Received message ${ message } , but unable to send it to webSocket as its state is: ${ webSocket . readyState } `
228+ `Received message ${ message } , but unable to send it to webSocket as its state is: ${ webSocket . readyState } ` ,
229229 ) ;
230230 }
231231 } ) ;
0 commit comments