Skip to content

Conversation

@danilvalov
Copy link

@danilvalov danilvalov commented Dec 27, 2025

Issue: #999

Usage example:

import { GoogleGenAI } from '@google/genai';
import { socksDispatcher } from 'fetch-socks';

const socks5Dispatcher =  socksDispatcher({
  type: 5 as const,
  host: 'some_proxy_ip_or_domain',
  port: 1080,
});

const fetchWithSocks = async (
  input: RequestInfo | URL,
  init?: RequestInit
): Promise<Response> => {
  return fetch(input, {
    ...init,
    dispatcher: socks5Dispatcher,
  } as RequestInit & { dispatcher: typeof socks5Dispatcher });
};

const googleGenAI = new GoogleGenAI({
  apiKey: 'your_api_key',
  fetchImplementation: fetchWithSocks,
});

@google-cla
Copy link

google-cla bot commented Dec 27, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@shmishra99
Copy link
Collaborator

@danilvalov , Thank you for raising this PR. I have escalated it to the team for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants