Skip to content

the HTTP(S) Agent invalid #379

@qisuwan

Description

@qisuwan

Environment

demo package.json

{
  "name": "demo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "test": "node src/index.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "http-proxy-agent": "^7.0.2",
    "https-proxy-agent": "^7.0.4",
    "ofetch": "^1.3.4"
  }
}

Reproduction

The demo code

import { HttpProxyAgent } from 'http-proxy-agent'
import { ofetch } from 'ofetch'

const res1 = await ofetch('http://ip-api.com/json')

const res2 = await ofetch('http://ip-api.com/json', {
  agent: new HttpProxyAgent('http://127.0.0.1:7890'),
})

console.log('No Proxy IP: ' + res1.query)
console.log('Proxy IP: ' + res2.query)

Describe the bug

console print

No Proxy IP: 125.70.78.162
Proxy IP: 125.70.78.162

result is same, the set proxy is invalid

Additional context

No response

Logs

No response

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