# node-https-socks5-proxy

> 使用socks5协议转发nodejs https Api请求

Latest version **1.1.1** (published 2022-05-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install node-https-socks5-proxy
pnpm add node-https-socks5-proxy
yarn add node-https-socks5-proxy
bun add node-https-socks5-proxy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2022-05-16 |
| First published | 2020-10-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | tongzyang |
| Keywords | node, proxy, https, socks5 |

## Links

- npm: https://www.npmjs.com/package/node-https-socks5-proxy
- Homepage: https://github.com/Yotakot/https-over-socks5
- npm.io page: https://npm.io/package/node-https-socks5-proxy

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.21.0
- [tunnel](https://npm.io/package/tunnel.md) 0.0.6
- [@types/axios](https://npm.io/package/@types/axios.md) ^0.14.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2022-05-16
- 1.1.0 — 2022-05-16
- 1.0.9 — 2022-05-16
- 1.0.6 — 2020-11-05
- 1.0.5 — 2020-10-28
- 1.0.4 — 2020-10-28
- 1.0.3 — 2020-10-28
- 1.0.2 — 2020-10-28
- 1.0.1 — 2020-10-28
- 1.0.0 — 2020-10-28

## README

# node-https-socks5-proxy
###简介
使用 socks5 代理转发 nodejs 的 http/https 请求
###安装
```
npm i node-https-socks5-proxy
```

###使用

```javascript
import * as https from "https";
import * as ProxySocket from "node-https-socks5-proxy";

const HOST = "www.google.com";
const PORT = 443;
const PATH = "/";
//转发到本地的ssr客户端
const PROXY_HOST = "127.0.0.1";
const PROXY_PORT = 1086;

const req = https.request(
  {
    host: HOST,
    path: PATH,
    port: PORT,
    createConnection: (opt, oncreate) => {
      ProxySocket.createConnection(
        {
          proxyHost: PROXY_HOST,
          proxyPort: PROXY_PORT,
          port: PORT,
          host: HOST,
          https: true,
        },
        oncreate
      );
      return null;
    },
  },
  (res) => {
    console.log(res.headers);
    console.log(res.statusCode);
    console.log(res.statusMessage);
    res.on("data", (buf) => {
      console.log(buf.toString("utf-8"));
    });
  }
);
req.end();
```

---
_Source: https://npm.io/package/node-https-socks5-proxy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
