noreplydev / suiro

Suiro is a reverse connection service written in rust for HTTP protocol based services.
11 stars 3 forks source link

fix: Handle multiple sessions at once #3

Closed marc2332 closed 11 months ago

marc2332 commented 11 months ago

This PR allows handling multiple sessions at once.

Main branch:

image

PR:

image

My testing server (deno js):

import { Application } from "https://deno.land/x/oak/mod.ts";

const app = new Application();

const sleep = (ms) => new Promise(r => setTimeout(() => r(), ms))

app.use(async (ctx) => {
    await sleep(1000);
    ctx.response.body = "Hello World!";
});

await app.listen({ port: 3000 });

my testing client:

const A = async (n) => {
    await fetch("http://localhost:8080/RExH9NPsSCWqmG5JFC257A");
    console.log(n)
}
const B = async (n) => {
    await fetch("http://localhost:8080/iuIVdmhLTem2lTux-pzRKg");
    console.log(n)
}

A(1);
B(2);
A(3);
B(4);
A(5);
B(6);