@@ -338,18 +338,31 @@ export class ChannelStartupService {
338338 }
339339
340340 public async loadProxy ( ) {
341+ this . localProxy . enabled = false ;
342+
343+ if ( process . env . PROXY_HOST ) {
344+ this . localProxy . enabled = true ;
345+ this . localProxy . host = process . env . PROXY_HOST ;
346+ this . localProxy . port = process . env . PROXY_PORT || '80' ;
347+ this . localProxy . protocol = process . env . PROXY_PROTOCOL || 'http' ;
348+ this . localProxy . username = process . env . PROXY_USERNAME ;
349+ this . localProxy . password = process . env . PROXY_PASSWORD ;
350+ }
351+
341352 const data = await this . prismaRepository . proxy . findUnique ( {
342353 where : {
343354 instanceId : this . instanceId ,
344355 } ,
345356 } ) ;
346357
347- this . localProxy . enabled = data ?. enabled ;
348- this . localProxy . host = data ?. host ;
349- this . localProxy . port = data ?. port ;
350- this . localProxy . protocol = data ?. protocol ;
351- this . localProxy . username = data ?. username ;
352- this . localProxy . password = data ?. password ;
358+ if ( data ?. enabled ) {
359+ this . localProxy . enabled = true ;
360+ this . localProxy . host = data ?. host ;
361+ this . localProxy . port = data ?. port ;
362+ this . localProxy . protocol = data ?. protocol ;
363+ this . localProxy . username = data ?. username ;
364+ this . localProxy . password = data ?. password ;
365+ }
353366 }
354367
355368 public async setProxy ( data : ProxyDto ) {
0 commit comments