Page 3 of 9
Re: atomic web server threads
Posted: Thu Mar 28, 2024 7:56 am
by pjay
Thanks, I think I may have a use for this in the very near future.
You post so much useful code; I'm sure others have said before, but 'Idle' is not the correct username for someone so productive

Re: atomic web server threads
Posted: Thu Mar 28, 2024 9:27 am
by idle
pjay wrote: Thu Mar 28, 2024 7:56 am
Thanks, I think I may have a use for this in the very near future.
You post so much useful code; I'm sure others have said before, but 'Idle' is not the correct username for someone so productive
Thanks pjay, I've pursued being Idle for 30 odd years and now I get to live it! On an Island near the International Date Line East.
Re: atomic web server threads
Posted: Thu Mar 28, 2024 10:20 am
by Caronte3D
You creature becomes better and better

Re: atomic web server threads
Posted: Thu Mar 28, 2024 11:27 am
by idle
Caronte3D wrote: Thu Mar 28, 2024 10:20 am
You creature becomes better and better
Thanks, it's definitely a creature but it's alive.

Re: atomic web server threads
Posted: Fri Mar 29, 2024 2:06 am
by idle
added
Atomic_Server_Chr(v.i) ;return a proper surrogate pair for unicode values outside the BMP (Basic Multilingual Plane)
Tarted up the landing page and error page with google fonts and added favicon
Re: atomic web server threads
Posted: Fri Mar 29, 2024 10:21 am
by Caronte3D
On the first Atomic_Server_Init call you wrote "wwww" instead of "www"

Re: atomic web server threads
Posted: Fri Mar 29, 2024 10:48 am
by Caronte3D
Trying to use the server through internet (not local):
I changed the IPs to match the IP on my VPS.
I Opened the firewall for the atomic server.
Now I can access from internet (I can get simple pages), but...
I try to load a SpiderBasic example (the one called dialog.html) and it doesn't work, the background image start to load slowly, but abort.
Any idea what I'm doing wrong?
https://prnt.sc/5L5T1CXrYWnC
Re: atomic web server threads
Posted: Fri Mar 29, 2024 12:26 pm
by idle
Caronte3D wrote: Fri Mar 29, 2024 10:21 am
On the first Atomic_Server_Init call you wrote "wwww" instead of "www"
I did that as a test so it would go to the internal handler.
As for the other issue I don't know, maybe it's a time out or a buffer size

Re: atomic web server threads
Posted: Sat Mar 30, 2024 5:16 am
by idle
v 3.0.b2
adjusted buffer size and redid mutex
Re: atomic web server threads
Posted: Sat Mar 30, 2024 9:47 pm
by Caronte3D
Works nice with the last update

Re: atomic web server threads
Posted: Tue Apr 02, 2024 8:13 am
by idle
v3.0.6b3
changed scope of mutex, increased buffer size, still a bit slow across the big ditch, as in geographically opposite me.
Re: atomic web server threads
Posted: Wed Apr 03, 2024 3:55 am
by idle
v3.0.6b4
fixed thread clean up
Re: atomic web server threads
Posted: Fri Apr 05, 2024 6:31 am
by idle
v 3.0.7b1
Added Tag Preprocessor.
It assumes you have an html page with the the tag <?PB ElementsFillTable/> saved as .pbh and it will call the named runtime procedure to fill in the tag with dynamic html content. This eliminates the need for CGI or server side scripting languages as you have all the power of PureBasic to do what ever you want to fill in the content and it also gives you full access to the request and all it's parameters.
I've been thinking about the easiest option to host multiple sites on the same ports and it's really easy to do, so I think that will be the next task.
All you will need to do is name your www folders as the domain name eg -www.foo.com- and -www.bar.com- and then you can host multiple sites with the same server. (minus the - either end )
Re: atomic web server threads
Posted: Fri Apr 05, 2024 12:21 pm
by Caronte3D
Awesome!

Re: atomic web server threads
Posted: Fri Apr 05, 2024 2:00 pm
by benubi
Very nice "example" piece of work
The multi-threaded webserver project I abandoned grew in 16,000-20,000 lines, had many features but ultimately it grew too complex and I shot myself in the foot. It could even read .htaccess files to some degree and the other user/group configuration files "as if" supporting a few of those important basic function for auth or DirectoryIndex, on-the-fly zlib compression, SSL (but I have no valid certificates or don't understand enough of it), cached files, webforms, CGI (but not fast-cgi by the end) etc. I invented a pseudo script/batch to have a similar functionality to the tag preprocessor (I suppose) but perhaps too complicated and restricted in itself. Essentially it would be html pages with embedded batch/script parts but it went ugly
So hats off to your elegant solutions - I'll peek deeper into it, especially the tag preprocessor which attracts most of my curiosity for now
