Auto-create claw-apply proxy if it doesn't exist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,7 @@ export async function createBrowser(settings, profileNameOrKey) {
|
||||
const opts = { stealth: true };
|
||||
if (profileName) opts.profile = { name: profileName };
|
||||
|
||||
// Proxy: look up by name "claw-apply", fall back to settings proxy_id
|
||||
// Proxy: look up by name "claw-apply", create if missing
|
||||
try {
|
||||
for await (const proxy of kernel.proxies.list()) {
|
||||
if (proxy.name === 'claw-apply' && proxy.status === 'available') {
|
||||
@@ -48,10 +48,11 @@ export async function createBrowser(settings, profileNameOrKey) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!opts.proxy) {
|
||||
const newProxy = await kernel.proxies.create({ name: 'claw-apply', type: 'residential', country: 'US' });
|
||||
opts.proxy = { id: newProxy.id };
|
||||
}
|
||||
} catch {}
|
||||
if (!opts.proxy && kernelConfig.proxy_id) {
|
||||
opts.proxy = { id: kernelConfig.proxy_id };
|
||||
}
|
||||
|
||||
let kb;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user