https://github.com/lucasconstantino/procsy
A proxy building helper with subdomain support
https://github.com/lucasconstantino/procsy
cli oclif proxy proxy-server
Last synced: about 1 year ago
JSON representation
A proxy building helper with subdomain support
- Host: GitHub
- URL: https://github.com/lucasconstantino/procsy
- Owner: lucasconstantino
- Created: 2019-02-15T19:10:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T16:37:35.000Z (about 7 years ago)
- Last Synced: 2025-04-13T16:11:44.630Z (about 1 year ago)
- Topics: cli, oclif, proxy, proxy-server
- Language: JavaScript
- Size: 62.5 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# procsy
A proxy building helper with subdomain support.
[](https://oclif.io)
[](https://npmjs.org/package/procsy)
[](https://npmjs.org/package/procsy)
[](https://github.com/lucasconstantino/procsy/blob/master/package.json)
# Usage
```sh
npm install -g procsy
procsy -t http://google.com
```
## Subdomains
> Subdomain proxying in the localhost requires you [configure the `hosts` file](https://stackoverflow.com/questions/1078193/hosts-file-and-multiple-sub-domains) properly.
To proxy subdomain based requests, you can specify source subdomains and their targets in the following syntax:
`[subdomain],[target]`
## Examples:
### 1. Single subdomain
#### `/etc/hosts`:
```
127.0.0.1 app.dev api.app.dev
```
#### command:
```sh
procsy -t api,http://my-external-api.com
```
#### outcome:
| from | to |
| --------------------------- | --------------------------------- |
| `http://api.local.dev/path` | `http://my-external-api.com/path` |
| `http://local.dev/path` | `404` |
### 2. Multiple subdomains
#### `/etc/hosts`:
```
127.0.0.1 app.dev api.app.dev tracking.app.dev
```
#### command:
```sh
procsy -t api,http://my-external-api.com tracking,http://analytics.com
```
#### outcome:
| from | to |
| -------------------------------- | --------------------------------- |
| `http://api.local.dev/path` | `http://my-external-api.com/path` |
| `http://tracking.local.dev/path` | `http://analytics.com/path` |
| `http://local.dev/path` | `404` |
### 3. Subdomain & domain
#### `/etc/hosts`:
```
127.0.0.1 app.dev api.app.dev
```
#### command:
```sh
procsy -t api,http://my-external-api.com *,http://my-app.com
```
#### outcome:
| from | to |
| --------------------------- | --------------------------------- |
| `http://api.local.dev/path` | `http://my-external-api.com/path` |
| `http://local.dev/path` | `http://my-app.com/path` |