proxy diff working

This commit is contained in:
Ben Wilson
2023-08-13 23:26:06 -04:00
parent 5369b2dc12
commit 42235736fa
15 changed files with 504 additions and 20 deletions
+29
View File
@@ -0,0 +1,29 @@
import { Injectable, OnModuleInit } from '@nestjs/common';
import { Server, Socket } from 'net';
import { ProxyClient } from '../models/ProxyClient';
@Injectable()
export class ProxyService implements OnModuleInit {
constructor() {
}
async onModuleInit(): Promise<void> {
if (process.env.ENABLE_PROXY == 'true') {
console.log('Connecting to braiins');
const proxyServer = new Server(async (socket: Socket) => {
const proxyClient = new ProxyClient(socket);
});
proxyServer.listen(process.env.PROXY_PORT, () => {
console.log(`Proxy server is listening on port ${process.env.PROXY_PORT}`);
});
}
}
}