Skip to content

Commit

Permalink
fix: Rewire httpTunnelPort when iOS resumes (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Leblow committed Mar 20, 2024
1 parent c33899c commit e9554e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/backend/src/backendManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import initRnBridge from './rn-bridge'
import { INestApplicationContext } from '@nestjs/common'
import logger from './nest/common/logger'
import { OpenServices, validateOptions } from './options'
import { SOCKS_PROXY_AGENT } from './nest/const'

const log = logger('backendManager')

Expand Down Expand Up @@ -112,11 +113,16 @@ export const runBackendMobile = async () => {
const connectionsManager = app.get<ConnectionsManagerService>(ConnectionsManagerService)
connectionsManager.closeSocket()
})

rn_bridge.channel.on('open', async (msg: OpenServices) => {
const connectionsManager = app.get<ConnectionsManagerService>(ConnectionsManagerService)
const torControl = app.get<TorControl>(TorControl)
const proxyAgent = app.get<{ proxy: { port: string } }>(SOCKS_PROXY_AGENT)

torControl.torControlParams.port = msg.torControlPort
torControl.torControlParams.auth.value = msg.authCookie
proxyAgent.proxy.port = msg.httpTunnelPort

await connectionsManager.openSocket()
})
}
Expand Down

0 comments on commit e9554e2

Please sign in to comment.