1 | 'use strict';
|
2 |
|
3 | const child = require('child_process');
|
4 | const path = require('path');
|
5 | const cli = require('heroku-cli-util');
|
6 | const exec = require('heroku-exec-util');
|
7 | const https = require('https')
|
8 | const http = require('http')
|
9 | const fs = require('fs')
|
10 | const co = require('co');
|
11 |
|
12 | module.exports = function(topic, command) {
|
13 | return {
|
14 | topic: topic,
|
15 | command: command,
|
16 | description: 'Launch a SOCKS proxy into a dyno',
|
17 | help: `Example:
|
18 |
|
19 | $ heroku ps:socks --app murmuring-headland-14719
|
20 | Establishing credentials... done
|
21 | SOCKSv5 proxy server started on port 1080
|
22 | Use CTRL+C to stop the proxy`,
|
23 | args: [],
|
24 | flags: [{ name: 'dyno', char: 'd', hasValue: true, description: 'specify the dyno to connect to' }],
|
25 | needsApp: true,
|
26 | needsAuth: true,
|
27 | run: cli.command(co.wrap(run))
|
28 | }
|
29 | };
|
30 |
|
31 | function * run(context, heroku) {
|
32 | yield exec.initFeature(context, heroku, function *(configVars) {
|
33 | yield exec.createSocksProxy(context, heroku, configVars)
|
34 | });
|
35 | return new Promise(resolve => {})
|
36 | }
|