atomic web server threads

Share your advanced PureBasic knowledge/code with the community.
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

version 3.1.0b5
moved the logging
fixed a time out bug in send
added cache age on init, uri handlers and preprocessed pages are un cached.
pages with .pbh or .htm are passed to the preprocessor
added option to SetCookie to create a session cookie with bRandom flag uses CryptRandomData sha2

Seems to be stable now. :D
please feel free to try and crash it
https://atomicwebserver.com
highend
Enthusiast
Enthusiast
Posts: 162
Joined: Tue Jun 17, 2014 4:49 pm

Re: atomic web server threads

Post by highend »

@idle, if you don't mind...

Code: Select all

What is Atomic Webserver 3.1

... version of the original ...

... dependencies to host web gui or Spider Basic applications for the desktop and serve locally ...

Code: Select all

Features

Multiple servers ...

Code: Select all

What does it do and what do you want?

... that's equivalent to ...

Link to external resources

Simply set the listening ports, root directory and it's served

... like experience. Simply ...

... declare the procedure as ...
And at last the link:

Code: Select all

PRE PROCESSED PAGE
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

@Highend
umm, no, I don't want a critique of the website, I want people to attack it, so i can debug it.
Mesa
Enthusiast
Enthusiast
Posts: 433
Joined: Fri Feb 24, 2012 10:19 am

Re: atomic web server threads

Post by Mesa »

In the future, will there be an example of a blog-type page in which a person (logged in or not) can leave a permanent message?
(This interests me a lot)
THANKS.
User avatar
Caronte3D
Addict
Addict
Posts: 1355
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: atomic web server threads

Post by Caronte3D »

Mesa wrote: Wed May 22, 2024 10:30 am In the future, will there be an example of a blog-type page in which a person (logged in or not) can leave a permanent message?
(This interests me a lot)
THANKS.
I think (could be wrong) If you know how to code in PB, it's easy, on the server you can use a MariaDB database to save the messages and the communication from client to server could be a simple POST.
Last edited by Caronte3D on Wed May 22, 2024 8:48 pm, edited 1 time in total.
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

You have two choices use a html template page. .htm or. Pbh so the tag preprocessor calls your runtime procedure to fill in the dynamic html or use a urihandler which can also use template pages.
I will make an example.
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 772
Joined: Fri Dec 04, 2015 9:26 pm

Re: atomic web server threads

Post by skinkairewalker »

this is too incredible.
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

skinkairewalker wrote: Fri May 24, 2024 10:19 pm this is too incredible.
Yes well Its taking an incredibly long time to debug! :lol:
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

version 3.1.0b6
Fixed up receive to handle posts larger than the buffer, so you can upload via post
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 772
Joined: Fri Dec 04, 2015 9:26 pm

Re: atomic web server threads

Post by skinkairewalker »

Today I'm going to test it on macOs.
hoerbie
Enthusiast
Enthusiast
Posts: 136
Joined: Fri Dec 06, 2013 11:57 am
Location: DE/BY/MUC

Re: atomic web server threads

Post by hoerbie »

Hi idle,
at first I would really like to thank you for your really good work, although I have my own PB web server for my SB Android app and only trying to make use of your TLS server work, some of your server ideas inspired me.

When testing your actual download from some days ago, I've got some problems, maybe you want to have a look:

1. The windows x86 dll seems not to work fully. With only running the tls.pbi in PB 6.11 x86 there only comes a header redirect from the PB website, then the program dies. When running the tls.pbi in PB 6.11 x64 there's another message, that the program is talking http to a https server.
And when using the x86 dll in my own web server in PB 6.11 x86, there is only the network connect, but then no data comes in that my server could answer, while with PB 6.11 x64 the x64 dll seems to work with my server.

2. All your server examples give an error message, that there is no OpenConsole.

3. Your example ssl_server.pb has a timer to call a function updateDNS(), that can't be found. When fixing this there's also the same problem with the x86 dll from 1. and OpenConsole from 2.

4. I had some problems with PB finding the libtls*.dll, when the dll isn't found, but the tls_* functions still are called and then the program crashes with an error on address 0.

5. In the tls.pbi there is a problem with the Enumeration TLS_Errors, because in the Procedure Init_TLS there is the result=#True that means the value 1, but when the tls_init() gives an error, the result=#TLS_Error_InitFailed has also the value 1.

I'm not familiar with GitHub, so I'm not able to make reports or changes there, but if you need help or testing, I'm willing to help.
And for a working x86 dll I would also like to give a donation :D

Greets, hoerbie
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

Thanks Hoerbie,

Yes I need to clean up the examples, I thought I'd fixed them. I've been working between windows and linux and also developing a project with it and it got a bit messy. Also the live site is different from the bundled test site which complicates things even more.

I still need to look into doing http upgrades, I will look into that after I've tested the reverse proxy with SSL running on the same machine and across the Lan. I should get on to that next week.

I also need to look into the head requests a bit more and also how I process the requests as I need to read the head in the receive to get the content length of posts for when they're bigger than the buffer so it doesn't make sense to read it twice and then I can properly implement the http error handling.

I will look into the x86 windows libreTLS build and good spotting on the error codes, that was a bit of a brain fart.
I'm not sure what the issue is on x86 it keeps failing on tls_connect_socket.
Rebuilding it with latest VS runtimes rather than xp support didn't work in debug or release. I will try with 3.9.1 but that will create 3 dll's

edit
I just tried with 3.9.2 and got the same result. :?
fails on tls_connect_socket.
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

version 3.1.0b7
build of libreTLs 3.9.2 for windows x86 tls.dll, ssl.dll, crypto.dll
Fixed bug in tls.pbi that was preventing x86 to bind the tls context.
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

Added LibreTls 3.9.2 windows x64 build
User avatar
idle
Always Here
Always Here
Posts: 5834
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: atomic web server threads

Post by idle »

Version 3.1.0b8

Fixed up UTCtime bug which was failing on 6.11 final
Refixed reverse proxy though there's still an issue with SSL certs which might be a bug in libre 3.9.2
so while the https connection was secure for the target running on another port like 8081, the https connection to the proxy server was using the certs for the target machine. :?
Post Reply