Skip to content

Commit

Permalink
add dist to gitignore, rebase commits, convert code to es6, convert t…
Browse files Browse the repository at this point in the history
…o typescript (#259)
  • Loading branch information
jonluca authored Jun 29, 2022
1 parent 373b623 commit b901de9
Show file tree
Hide file tree
Showing 19 changed files with 3,571 additions and 3,159 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node_modules
npm-debug.log
.idea
.http-mitm-proxy
.vscode
.vscode
dist
36 changes: 0 additions & 36 deletions bin/mitm-proxy.js

This file was deleted.

36 changes: 36 additions & 0 deletions bin/mitm-proxy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#! /usr/bin/env node --experimental-specifier-resolution=node
import yargs from "yargs";
import { hideBin } from "yargs/helpers";

import d from "debug";
const debug = d("http-mitm-proxy:bin");
import Proxy from "../lib/proxy";
const proxy = new Proxy();

const args = yargs(hideBin(process.argv))
.alias("h", "help")
.alias("h", "?")
.options("port", {
default: 80,
describe: "HTTP Port.",
})
.alias("p", "port")
.options("host", {
describe: "HTTP Listen Interface.",
}).argv;

if (args.help) {
yargs.showHelp();
process.exit(-1);
}

proxy.onError((ctx, err, errorKind) => {
debug(errorKind, err);
});
proxy.listen(args, (err) => {
if (err) {
debug(`Failed to start listening on port ${args.port}`, err);
process.exit(1);
}
debug(`proxy listening on ${args.port}`);
});
3 changes: 0 additions & 3 deletions index.js

This file was deleted.

3 changes: 3 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import proxy from './lib/proxy'

export default proxy;
245 changes: 0 additions & 245 deletions lib/ca.js

This file was deleted.

Loading

0 comments on commit b901de9

Please sign in to comment.