9
Ranchonyx
61d

I was working on a thing at work which routes http requests from one endpoint and port to several local services.
I was halfway done when I noticed I just wrote a primitive reverse proxy.

Anyway, I'm calling it GRID, Gateway for REST Interface Distribution.

It's capable of dynamically attaching new routes and services and removing those during runtime via inbuilt typescript compilation service.

Each "runtime module" defines several routes which may have a middleware function (express.js style), which gets executed before forwarding the request to the local service.

I don't know why, but I'm kinda proud of this one; Feels like I made something actually useful for once.

Gonna maybe add a webUI with the monaco editor to write typescript modules without needing VSCode...

Also I may implement a load balancing system for scalability.

It comes with a cli too.

Gonna put it on github and post it here once I'm done with v1.

Comments
  • 2
    I so wish i could show you my network scripts without it being a dumb security decision... it's like if early 2000s hard coded, hard wired, networking was genetically spliced with macvlan and pseudo-dynamic brctl bash scripting, yet somehow epitomised the intended original concept of CSS.

    The result ends up being similar to a reverse proxy's functionality on a base level yet highly configurable, needing only small tweaks to modify/adapt the flow... i tend to make very lean, high functionality systems and programs... but they also tend to break most people's brain if they try to understand the base code.
  • 1
    Sounds good! Cool, can't wait. Also played with Monaco editor once but then found out I could run vscode on a container in the browser that did everything - apt etc I went for that. Who'll use the webui?
  • 1
    @awesomeest That sounds demonic. I understand less than half, but it sounds fun :)
  • 1
    @retoor Administrators, or generally anyone with permission change system configuration.
  • 1
    @Ranchonyx
    i be scripting like CSS.

    (That should totally be on a tshirt... but so few would understand :'( )

    I started networking at a pro level around 7 or 8 (i was my schools only competent computer tech)... so ~25yrs ago. That was still the era of phone lines, AOL and plenty of half-duplex connections. Im a dinosaur that gets easily annoyed with 'helpful, easy-to-use, tools' like NetworkManager... i tend to end up just dismantling these things then rebuilding to my preferences (or starting from scratch)

    For those who dont know:
    Half-duplex is when a connect can only send OR recieve data at one time. Full-duplex is what most of the world has been on for decades.
  • 2
    and I'm over here rewriting the design for my threadpool to process various http calls through a swarm of proxies still
  • 1
    Ever heard of graphQL ? Seems like you are redoing the job already done
  • 0
    @NoToJavaScript Yes, I've heard of it, however learning a new technology is something I've (sadly) got no time for at the moment.

    I will check it out more after my current workload decreases, thanks for mentioning it :)
  • 2
    @awesomeest Half duplex, fuck.
    Yeah, that's been a while.

    I think those 'older' technologies are somewhat charming though.

    Token ring be like
    "I have <token>. You be silent, kurwa."
  • 1
    @Ranchonyx I agree. Same for me, finding time to learn a new techno is difficult.

    But this one I do not regret investing time in !

    My back end went from soemthing like 25 controller files REST and around 3K lines to only 1 controller, 1 entry point and like 700 lines of code total
  • 1
    @NoToJavaScript That's impressive, however I wonder: If there's such a stark difference, there must be some overhead, no?
  • 1
    @Ranchonyx YES. You are right.

    My current stack, for the simpliest request ever (Which commes from cache, NOT ONE SQL querry) is a minimum of 30 ms.

    This is overhead to make every thing generic, using reflexion a LOT etc.

    But the average stats are around 300 ms per request. 9Some requests are VERY VERY slow and drive average, but these requests usually requires like 200 SQL requests).

    And the server is perfectly capable to manage it in parallel mode.

    So basiclly front end will do 10 to 20 querry at the same time. All 10 will get back in less than 300 ms. So total time to load all nedded data for dfron is 300 ms.

    And with rest, sometimnes we needed to wait a retuern on a request to get somedata to do a second request REST.

    Bref, just my experiance lol
  • 1
    @Ranchonyx mind if i ask your age?
    The last time a person knew, from experience, things i mentioned from around the time i started programming/etc, had started in the industry around the same time... but was 60 (im 32now, 31 at the time).
    I don't really have peers unfortunately.
  • 3
    @awesomeest I don't mind, I'm 21.
    The reason why I know a lot of that stuff is because in my region of Germany, they modernised the cable network way later. ...That, and we had a half-duplex printer.

    I vividly remember my father occasionally losing his patience to said printer :>

    Then there's me watching a load of retro tech content. I'm a big fan of the 6502, and by extension the C64.
    I just find older tech charming, as I said.
  • 1
    @Ranchonyx ehh, well you may be more of an oddball in tech than me... unless you're like a hipster or the cult-esq DIY type.

    upper middle class family with a somewhat prominent inventor grandfather... so we weren't behind on tech. my father was a hoarder and i was highly unsupervised as a kid... add remarkable intelligence and undiagnosed autism, and it somehow makes perfect sense that i was teaching myself how to take apart computers, down to removing components from and sawing apart mobos, soldering and remapping them by age 8.... oh and dismantling modems, assuming id find components similar to the inside of a phone... because of the dial tone and use of phone line... i was very disappointed.

    the 90s were great for me... unlimited free floppy disks everywhere (mostly cuz AOL), html and css didn't have numbers after them, static ip addresses were just called ip addresses... BSOD fixes included a direct microsoft call, to a human... i could still use DOS <3... *sigh* i miss DOS
  • 1
    @awesomeest I'd like to formally clarify that I'm not a hipster. I just like older tech.
  • 1
    @Ranchonyx
    good... hipsters and the chronic DIYers drive me nuts. for DIYers i don't mean someone who just prefers learning to do something themself... i mean the ones that view DIY like a hobby and\or bookclub type thing.

    I doubt you'd know this due to your age (and most my age)...
    Back in the really late 90s early 00s, there was a rampant increase of annoyance in programming\etc forums. There'd be a bunch of legit pro-level computer nerds... nearly all were socially awkward men... never came across another grade schooler, esp female.

    Then some occasional dimwits, totally unaware of their innate differences, would show up to warn and seek advice from the community...
  • 1
    @Ranchonyx
    Most commonly, something like this:
    E(aka dimwit)- hey guys i discovered this super advanced virus because my computer was slow... i removed it but it came back with a vengeance and now it's everywhere, giving BSODs.

    P(programmers)- Ok... what'd you already try? logs? details?

    E- *very verbose and elaborate, akin to a heroic tale of slaying a dragon-like hydra, called "svchost.exe"*

    P- That's not a virus. It's a system process. Don't touch it.

    E- Oh, I know; the virus is disguised. I only figured it out because there was more than 1. watch out guys it almost fooled me!

    P- No, it's a generic service that handles many processes, a few is normal. kill them and more start, trying to stop you from crashing your PC

    E- *more grandiose tales of destroying their own system to root out a non-existent virus*

    P(new2convo)- Maybe I can help?

    P- Well, this enthusiast is beyond my limits. gl.

    DIYers (and most hipsters) give me the same vibe if attempting a convo.
  • 1
    @Ranchonyx
    Basically, it's just way harder to identify these people, and their inherent wasting of valid time\human goodwill nowadays... cuz if they figured out that a term like "enthusiast" was being used to identify them as a perplexing waste of time\nearly impossible to help... then it'd turn into some version of a hate crime im sure.
Add Comment