atomic web server threads
Re: atomic web server threads
Thanks benbi It's not so easy to keep it simple, I could add a few 1000 lines in an instant but I'm trying to keep it closer to plain pb which I find hard to do.
I could also simplify it a lot more by by using one thread per client, but I think this way where a client can have mutiple requests going at once might be better performance than queuing and serializing. Infratec kindly sent me his multi threaded server so I can test, the difference and see which is better. Tcp is tricky to tune.
I could also simplify it a lot more by by using one thread per client, but I think this way where a client can have mutiple requests going at once might be better performance than queuing and serializing. Infratec kindly sent me his multi threaded server so I can test, the difference and see which is better. Tcp is tricky to tune.
Re: atomic web server threads
After Caronte3D spun up a server in Germany and sent me the link to test, I'm happy to say it's fast enough, it only took 5 seconds to download the ~6mb test payload from NZ which is pretty good.
I've been adding shared servers, so you can run multiple sites on the same server and port. you just add a folder with the domain name under your www/ folder. Then to test just add the domains to your hosts file
for now I've tested for ".." in the *request\host string to avert it but I'm not sure if that's good enough?
There's still a bit to do before it's ready.
I've been adding shared servers, so you can run multiple sites on the same server and port. you just add a folder with the domain name under your www/ folder. Then to test just add the domains to your hosts file
but while this uses the host: field so set the directory it adds a risk of escaping the root directory127.0.0.1 atomicwebserver.com
127.0.0.1 atomicwebserver3.com
for now I've tested for ".." in the *request\host string to avert it but I'm not sure if that's good enough?
There's still a bit to do before it's ready.
Re: atomic web server threads
Glad to help
Do you think SSL would be doable for atomic server, without all the inherent complexity?

Do you think SSL would be doable for atomic server, without all the inherent complexity?
Re: atomic web server threads
Yes absolutely, it's not that hard to do for windows or Linux but I don't know about mac OS or arm builds.Caronte3D wrote: Mon Apr 08, 2024 8:49 am Glad to help![]()
Do you think SSL would be doable for atomic server, without all the inherent complexity?
I'm still working through how to present the adaptation to support shared servers which is something I need, however it complicates things a bit from the users perspective and it also has an impact on how to do TLS for shared servers. So once I've got that sorted I can look to adding it.
Re: atomic web server threads
Go, go, go!



Re: atomic web server threads
In the case of a shared application server I'm still looking into how to do it as a dll plug-in, that way you can recompile your app without shutting the server down or recompiling it. By dynamicly loading and unloading your application dll. your dll hosts the urihandlers and runtime procedures required by your application to process the info.
Once I've got that ironed out I can look at doing SSL.
Once I've got that ironed out I can look at doing SSL.
Re: atomic web server threads
It seems like a good idea to use a DLL 

Re: atomic web server threads
I decided to build in a reverse proxy, which is a much better solution overall as you can totally isolate the servers and then they don't need to be on the same instance, machine or network.
it seems to be working fine on the same instance and also as separate instances .
Though it's it's still not 100% and it doesn't work so well across the Lan?
The short of it is you can run multiple servers on different ports and interfaces and still access them through the proxy
to make atomicwebserver1.com, proxy calls to atomicwebserver2.com
and server 2
still a bit of debugging to do before its ready
it seems to be working fine on the same instance and also as separate instances .

Though it's it's still not 100% and it doesn't work so well across the Lan?
The short of it is you can run multiple servers on different ports and interfaces and still access them through the proxy
to make atomicwebserver1.com, proxy calls to atomicwebserver2.com
Code: Select all
server1 = Atomic_Server_Init("atomicwebserver1.com","www/","192.168.1.10","atomicwebserver1.com",80,#PB_Network_IPv4,5000,@CBPost(),@CBGet())
Atomic_Server_Add_Proxy(server1,"atomicwebserver2.com","127.0.0.1",81)
Code: Select all
server2 = Atomic_Server_Init("atomicwebserver2.com","www/","127.0.0.1","atomicwebserver2.com",81,#PB_Network_IPv4,5000,@CBPost(),@CBGet())
- skinkairewalker
- Enthusiast
- Posts: 772
- Joined: Fri Dec 04, 2015 9:26 pm
Re: atomic web server threads
This is brilliant, excellent work.
Re: atomic web server threads
It should be ready to post next week, I'm still debugging the reverse proxy and I also need to finish off the use case examples and edit the test site contents.
Re: atomic web server threads
a somewhat slow test site to US and Europe atomicwebserver.com
I will put on a cloud VM at some point as it's just to slow from the island
I will put on a cloud VM at some point as it's just to slow from the island
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: atomic web server threads
Hi Idle,
great work! For a few years now, I am looking for a decent way to remove electron and other blown up solutions for local webpages from my workflow. This seems to be it! Thanks for the work. Really looking forward for things like SSL and GZIP!
I tried to download the code via "Get Code" from the page, it always stopped after a few kbs. Maybe, Germany is too far away from NZ...
great work! For a few years now, I am looking for a decent way to remove electron and other blown up solutions for local webpages from my workflow. This seems to be it! Thanks for the work. Really looking forward for things like SSL and GZIP!
I tried to download the code via "Get Code" from the page, it always stopped after a few kbs. Maybe, Germany is too far away from NZ...
Regards,
JamiroKwai
JamiroKwai
Re: atomic web server threads
I'll put the code on github today.jamirokwai wrote: Sun Apr 14, 2024 6:19 pm Hi Idle,
great work! For a few years now, I am looking for a decent way to remove electron and other blown up solutions for local webpages from my workflow. This seems to be it! Thanks for the work. Really looking forward for things like SSL and GZIP!
I tried to download the code via "Get Code" from the page, it always stopped after a few kbs. Maybe, Germany is too far away from NZ...
it'll be easy enough to add support for deflate and gzip
Re: atomic web server threads
Added to github with test site.
https://github.com/idle-PB/atomic_webserver_3
https://github.com/idle-PB/atomic_webserver_3
Re: atomic web server threads
Thanks very much Idle, there is the below code which won't compile, as it's attemping to put -1 into an unsigned .a
Line 520: Overflow error a 'ascii' (.a) value must be between 0 and 255
Code: Select all
Structure ST
a.a[256]
EndStructure
Static skiptable.ST
[...]
For i = 0 To 255
Skiptable\a[i] = -1;