libetl / local-traffic Goto Github PK
View Code? Open in Web Editor NEWtiny reverse-proxy made with typescript
License: The Unlicense
tiny reverse-proxy made with typescript
License: The Unlicense
Use local-traffic to route traffic through remote containers (if it is possible without external dependency)
Show in the console logging if traffic was sent to the default route or was a higher rule.
Given this mapping:
{
"mapping": {
"/a-path":": "http://localhost:8080/a-path/",
"": "https://www.a-domain.com/"
}
}
Current behaviour:
Any path that is on localhost will be proxied to "https://www.a-domain.com/". But in case of https:localhost/a-path it will be proxied to http://localhost:8080/a-path/, however when http://localhost:8080/a-path is not running local-traffic will display an error.
Could be nice to add a config to fall back to default in case the mapped url is not healthy.
I would love to be able to connect my proxy to some kind of streaming cloud service such as kinesis or kafka. Does it make sense do that on the proxy level or rather should i consume the log files ?
The status lines in the console render differently depending on the terminal, because the emojis sometimes are larger than their allocated size, causing some status lines to print irregularly
I should try to display the quickStatus in two steps : firstly only the table cells, then each individual column
import { stdout } from 'process'
(async () => {
console.log('\u001b[48;5;52m ' +
'▐\u001b[48;5;53m ' +
'▐\u001b[48;5;54m ' +
'▐\u001b[48;5;55m ' +
'▐\u001b[48;5;56m ' +
'▐\u001b[48;5;57m ' +
'▐\u001b[48;5;93m ' +
'▐\u001b[0m');
await new Promise(resolve =>
stdout.moveCursor(-80, -1, () => resolve(void 0)));
stdout.write('\u001b[48;5;52m☎️ 443\u001b[0m')
await new Promise(resolve =>
stdout.moveCursor(-80, 0, () =>
stdout.moveCursor(12, 0, () => resolve(void 0))));
stdout.write('\u001b[48;5;53m↗️ H/2 ✒️\u001b[0m')
await new Promise(resolve =>
stdout.moveCursor(-80, 0, () =>
stdout.moveCursor(24, 0, () => resolve(void 0))));
stdout.write('\u001b[48;5;54m↘️ H/2 ✒️\u001b[0m')
await new Promise(resolve =>
stdout.moveCursor(-80, 0, () =>
stdout.moveCursor(36, 0, () => resolve(void 0))));
stdout.write('\u001b[48;5;55m🔗 52\u001b[0m')
await new Promise(resolve =>
stdout.moveCursor(-80, 0, () =>
stdout.moveCursor(45, 0, () => resolve(void 0))));
stdout.write('\u001b[48;5;56m☄️\u001b[0m')
await new Promise(resolve =>
stdout.moveCursor(-80, 0, () =>
stdout.moveCursor(50, 0, () => resolve(void 0))));
stdout.write('\u001b[48;5;57m✨\u001b[0m')
await new Promise(resolve =>
stdout.moveCursor(-80, 0, () =>
stdout.moveCursor(55, 0, () => resolve(void 0))));
stdout.write('\u001b[48;5;93m🛡️\u001b[0m')
console.log()
})()
Is the goal of the proxy to be in local environment only ? How will it behave if for example I use it in front of an app on a server ?
If that is possible, it could be cool to have some kind of UI with real time data to monitor the traffic. Or have the capacity to plus it to monitoring tool through open telemetry for example.
Investigate injecting traffic using a SOCKS5 protocol.
So that users can continue to navigate to downstreamURLs while using the proxy.
Might be something non-feasible but I would love to be able mirror my traffic when targeting a specific endpoint ?
Let's say I redirect my traffic to my-service/v1
, in addition to forwarding to the configured endpoint, could you duplicate the request and send it to my-service/v2
and log the result ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.