Skip to content

Improving Developer Experience (DX) - Proxy option #266

@bitcrafterhub

Description

@bitcrafterhub

I was reviewing the source code for the Ollama class instantiation and noticed the proxy option behaves differently than standard Node.js conventions.

In most Node.js networking libraries (like axios, node-fetch, etc.), the term proxy typically implies an HTTP Forward Proxy (using an http.Agent to tunnel traffic through a firewall). However, looking at the implementation here, the proxy option appears to perform URL formatting/host replacement (effectively acting as a Reverse Proxy URL or Base URL override).

Developers trying to configure a corporate forward proxy (e.g., for egress traffic) will mistakenly try to put their proxy agent string here, which may fail or behave unexpectedly if the code merely formats it as the destination host. It is unclear if this option is meant for CORS handling (browser context) or network tunneling (Node context).

Change proxy to something more descriptive of its actual behavior. If keeping the name proxy is necessary for backward compatibility, please explicitly document that this is for URL rewriting/forwarding and not for setting an HTTP Agent..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions