Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
ba55019846 | |||
6f967553d6 | |||
64df05a868 | |||
0a8ae81fd0 |
@ -14,4 +14,4 @@
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
}
|
||||
}
|
||||
}
|
1420
package-lock.json
generated
1420
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartproxy",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.4",
|
||||
"private": false,
|
||||
"description": "a proxy for handling high workloads of proxying",
|
||||
"main": "dist/index.js",
|
||||
@ -20,5 +20,21 @@
|
||||
"tslint": "^5.11.0",
|
||||
"tslint-config-prettier": "^1.15.0"
|
||||
},
|
||||
"dependencies": {}
|
||||
"dependencies": {
|
||||
"@types/express": "^4.17.1",
|
||||
"@types/http-proxy-middleware": "^0.19.3",
|
||||
"express": "^4.17.1",
|
||||
"http-proxy-middleware": "^0.19.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/*",
|
||||
"ts_web/*",
|
||||
"dist/*",
|
||||
"dist_web/*",
|
||||
"dist_ts_web/*",
|
||||
"assets/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
}
|
||||
|
26
readme.md
Normal file
26
readme.md
Normal file
@ -0,0 +1,26 @@
|
||||
# @pushrocks/smartproxy
|
||||
a proxy for handling high workloads of proxying
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartproxy)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartproxy)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smartproxy)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartproxy/)
|
||||
|
||||
## Status for master
|
||||
[](https://gitlab.com/pushrocks/smartproxy/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smartproxy/commits/master)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smartproxy)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smartproxy)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
@ -1,8 +1,8 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartproxy from '../ts/index'
|
||||
import * as smartproxy from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log(smartproxy.standardExport)
|
||||
})
|
||||
console.log(smartproxy);
|
||||
});
|
||||
|
||||
tap.start()
|
||||
tap.start();
|
||||
|
@ -1,3 +1 @@
|
||||
import * as plugins from './smartproxy.plugins';
|
||||
|
||||
export let standardExport = 'Hi there! :) This is an exported string';
|
||||
export * from './smartproxy.classes.smartproxy';
|
||||
|
7
ts/interfaces/index.ts
Normal file
7
ts/interfaces/index.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export interface IHostConfig {
|
||||
hostName: string;
|
||||
destination: string;
|
||||
destinationPort: number;
|
||||
privateKey: string;
|
||||
publicKey: string;
|
||||
}
|
3
ts/smartproxy.classes.router.ts
Normal file
3
ts/smartproxy.classes.router.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as plugins from './smartproxy.plugins';
|
||||
|
||||
export class SmartproxyRouter {}
|
29
ts/smartproxy.classes.smartproxy.ts
Normal file
29
ts/smartproxy.classes.smartproxy.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import * as plugins from './smartproxy.plugins';
|
||||
import * as interfaces from './interfaces';
|
||||
|
||||
import { SmartproxyRouter } from './smartproxy.classes.router';
|
||||
|
||||
export class SmartProxy {
|
||||
public expressInstance: plugins.express.Express;
|
||||
public httpsServer: plugins.https.Server;
|
||||
public router = new SmartproxyRouter();
|
||||
|
||||
public hostCandidates: interfaces.IHostConfig[] = [];
|
||||
|
||||
public addHostCandidate(hostCandidate: interfaces.IHostConfig) {
|
||||
// TODO search for old hostCandidates with that target
|
||||
this.hostCandidates.push(hostCandidate);
|
||||
}
|
||||
|
||||
/**
|
||||
* starts the proxyInstance
|
||||
*/
|
||||
public async start() {
|
||||
this.expressInstance = plugins.express();
|
||||
this.httpsServer = plugins.https.createServer(this.expressInstance);
|
||||
}
|
||||
|
||||
public async update() {
|
||||
await this.start();
|
||||
}
|
||||
}
|
@ -1,4 +1,10 @@
|
||||
const removeme = {};
|
||||
export {
|
||||
removeme
|
||||
}
|
||||
// node native scope
|
||||
import * as https from 'https';
|
||||
|
||||
export { https };
|
||||
|
||||
// third party scope
|
||||
import express from 'express';
|
||||
import * as httpProxyMiddleware from 'http-proxy-middleware';
|
||||
|
||||
export { express, httpProxyMiddleware };
|
||||
|
Reference in New Issue
Block a user