Page 10 of 10

Re: atomic web server threads

Posted: Fri Nov 14, 2025 2:57 am
by skinkairewalker
Is it possible for us to create a web server that is compatible with all operating systems using the PureBasic network library?
And if we remove complex structures and leave only the HTTP server for the local network? I think that this way we can make protected web apps with webview — or am I wrong?

in MacOS (ARM) occurs :
Image


in linux (ARM with parallels desktop) occurs :
Image

Re: atomic web server threads

Posted: Fri Nov 14, 2025 4:22 am
by idle
Yes you can use it to serve on localhost to serve to either a web gadget or users browser.
It looks like the static lib is missing a dependency on the linux system.

I haven't tested on arm recently and I don't have access to a Mac to test on.
Did you try with a lower port number like 8081 ?
Also if your not using tls find the usetls() and comment it out as there's no point using tls on localhost or loopback.

Re: atomic web server threads

Posted: Fri Nov 14, 2025 5:26 am
by skinkairewalker
Strange behavior on Linux, the dependency is installed.
What could be calling this dependency?
Image

Re: atomic web server threads

Posted: Sun Nov 16, 2025 4:56 am
by idle
it's missing a dependency. I can't help you with that at the moment though.

Re: atomic web server threads

Posted: Sun Nov 16, 2025 11:30 am
by mk-soft
Mint Linux LMDE 7 (Debian 13)
With TLS Server I always have with TLS functions "Invaild Memory Access", but have an address after importing to the function?

Other thing:
With linux you should not call the MessageRequester from a thread (crash)

Fix for Linux

Code: Select all

CompilerIf #PB_Compiler_OS = #PB_OS_Linux
  Procedure MyMessageRequester(Title.s, Text.s, Flags=0)
    Protected r1
    gdk_threads_enter_();
    r1 = MessageRequester(Title, Text, Flags)
    gdk_flush_()
    gdk_threads_leave_()
    ProcedureReturn r1
  EndProcedure
  
  Macro MessageRequester(Title, Text, Flags=0)
    MyMessageRequester(Title, Text, Flags)
  EndMacro
CompilerEndIf

Re: atomic web server threads

Posted: Mon Nov 17, 2025 9:55 am
by infratec
Maybe you need

libbsd-dev (libbsd)

in ubuntu.

Re: atomic web server threads

Posted: Mon Nov 17, 2025 4:42 pm
by skinkairewalker
infratec wrote: Mon Nov 17, 2025 9:55 am Maybe you need

libbsd-dev (libbsd)

in ubuntu.
I achieved the goal I was aiming for xD
My only concern is that the code is quite "unprofessional" :
viewtopic.php?t=87904