fix(core): update
This commit is contained in:
@ -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;
|
||||
}
|
5
ts/smartproxy.classes.router.ts
Normal file
5
ts/smartproxy.classes.router.ts
Normal file
@ -0,0 +1,5 @@
|
||||
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,15 @@
|
||||
const removeme = {};
|
||||
// node native scope
|
||||
import * as https from 'https';
|
||||
|
||||
export {
|
||||
removeme
|
||||
}
|
||||
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