Files
2026-07-13 13:23:39 +08:00

15 lines
513 B
TypeScript

import { Server as ProxyChainServer } from 'proxy-chain';
// --proxy-bypass-list=<-loopback> for launching Chrome
export const createProxyServer = (localAddress: string, username: string, password: string): ProxyChainServer => {
return new ProxyChainServer({
port: 0,
prepareRequestFunction: (input) => {
return {
localAddress,
requestAuthentication: input.username !== username || input.password !== password,
};
},
});
};