# socks5-http-client

> SOCKS v5 HTTP client.

Latest version **1.0.4** (published 2018-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install socks5-http-client
pnpm add socks5-http-client
yarn add socks5-http-client
bun add socks5-http-client
```

## 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.0.4 |
| Published | 2018-07-05 |
| First published | 2013-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.4.0 |
| Dependencies | 1 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 253 |
| Author | Matthew Caruana Galizia |
| Maintainers | mcg |
| Keywords | socks5, socksv5, socks, v5, http, tor, client |

## Links

- npm: https://www.npmjs.com/package/socks5-http-client
- Repository: https://github.com/mattcg/socks5-http-client
- Issues: https://github.com/mattcg/socks5-http-client/issues
- npm.io page: https://npm.io/package/socks5-http-client

## Dependencies (1)

- [socks5-client](https://npm.io/package/socks5-client.md) ~1.2.6

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2018-07-05
- 1.0.3 — 2018-04-01
- 1.0.2 — 2015-11-13
- 1.0.1 — 2015-02-25
- 1.0.0 — 2015-02-25
- 0.1.6 — 2013-12-04
- 0.1.5 — 2013-05-23
- 0.1.4 — 2013-04-18
- 0.1.3 — 2013-03-05
- 0.1.2 — 2013-03-04
- 0.1.1 — 2013-03-04
- 0.1.0 — 2013-03-04

## README

# SOCKS5 HTTP Client #

[![Build Status](https://travis-ci.org/mattcg/socks5-http-client.png?branch=master)](https://travis-ci.org/mattcg/socks5-http-client)

SOCKS v5 HTTP client implementation in JavaScript for Node.js.

```js
var shttp = require('socks5-http-client');

shttp.get('http://www.google.com/', function(res) {
	res.setEncoding('utf8');
	res.on('readable', function() {
		console.log(res.read()); // Log response to console.
	});
});
```

URLs are parsed using `url.parse`. You may also pass an options hash as the first argument to `get` or `request`.

## Options ##

Specify the `socksHost` and `socksPort` options if your SOCKS server isn't running on `localhost:1080`. Tor runs its SOCKS server on port `9050` by default, for example.

Specify a username and password using `socksUsername` and `socksPassword`.

## Using with Tor ##

Works great for making HTTPS requests through [Tor](https://www.torproject.org/).

Make sure a Tor server is running locally and run `node example/tor http://en.wikipedia.org/wiki/SOCKS` to test.

## Using with Request ##

To use with [Request](https://github.com/mikeal/request), just pass a reference to the `Agent` constructor.

```js
var Agent = require('socks5-http-client/lib/Agent');

request({
	url: 'http://en.wikipedia.org/wiki/SOCKS',
	agentClass: Agent,
	agentOptions: {
		socksHost: 'my-tor-proxy-host', // Defaults to 'localhost'.
		socksPort: 9050 // Defaults to 1080.
	}
}, function(err, res) {
	console.log(err || res.body);
});
```

## HTTPS ##

This client only provides support for making HTTP requests. See [socks5-https-client](https://github.com/mattcg/socks5-https-client) for an HTTPS implementation.

## License ##

Copyright © 2013 [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia), licensed under an [MIT license](http://mattcg.mit-license.org/).

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