# proxy-docker

> Create docker containers and proxy HTTP requests to them

Latest version **1.0.3** (published 2016-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install proxy-docker
pnpm add proxy-docker
yarn add proxy-docker
bun add proxy-docker
```

## 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.3 |
| Published | 2016-01-26 |
| First published | 2016-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Roi Avinoam |
| Maintainers | avinoamr |
| Keywords | docker, container, proxy, middleware |

## Links

- npm: https://www.npmjs.com/package/proxy-docker
- Repository: https://github.com/panoplyio/proxy-docker
- Issues: https://github.com/panoplyio/proxy-docker/issues
- npm.io page: https://npm.io/package/proxy-docker

## Dependencies (6)

- [debug](https://npm.io/package/debug.md) ^2.2.0
- [extend](https://npm.io/package/extend.md) ^3.0.0
- [express](https://npm.io/package/express.md) ^4.13.4
- [bluebird](https://npm.io/package/bluebird.md) ^3.1.4
- [dockerode](https://npm.io/package/dockerode.md) ^2.2.9
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.12.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-01-26

## README

# docker-proxy
Create docker containers and proxy HTTP requests to them

```javascript
var proxydocker = require( 'proxy-docker' );
var proxy = proxydocker()

    // define the container create config
    .create({
        Image: 'wordpress',
        ExposedPorts: { '8080/tcp': {} },
        HostConfig: {
            PortBindings: { '8080/tcp': [ { HostPort: '' } ] }
        }
    });

express()
    .get( '/somewhere', function ( req, res ) {
        // intercept requests before the proxying to the container
        res.send( 'Hello world.' );
    })
    .use( function ( req, res, next ) {
        // set a container name for the request.
        // proxy-docker will use it to proxy the request to the 
        // correct container, or create a new one if none exists
        // for that name.
        req.session.container = req.user.name; 
        next()
    })

    // all other requests will be proxied to the container
    .use( proxy.server() );
```

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