You need to run 2 instances of the TSynHttpServer with different settings in order to handle HTTP and HTTPS at the same time.

Yury Sidorov,
j...@cp-lab.com

On 6/13/2017 7:54 PM, Stefan Fischer wrote:
Hi Yury,

thank you very much. It works. Http or Https.

Just to crosscheck. To start http and https in parallel,

I need to start 2 threads?

one with InitHttps('cert.cer', 'key.pem', '', 'ca.cer')

Thats my current config to have a serving on port 80 and 443.

Again thank you very much. It works so far.

Stefan


    -----Ursprüngliche Nachricht-----
    *Von:* Yury Sidorov <j...@cp-lab.com>
    *Gesendet:* Die 13 Juni 2017 17:39
    *An:* synalist-public@lists.sourceforge.net
    *Betreff:* Re: [Synalist] HTTPS Server demo on debian and raspberry pi

    Hi,

    The web serer is running in a separate thread, therefore it will not block 
the main thread.

    I've added the demo program, which is running fine. Also some changes to 
work with FPC trunk.

    Get the updated sources:
    https://drive.google.com/open?id=0BxhmPD-N0cvgWjlnUkppLXZMZkU

    Yury Sidorov,
    j...@cp-lab.com

    On 6/13/2017 1:12 PM, Stefan Fischer wrote:
    > hi yuri,
> > since hours I try to get a working server with no luck. > > after succesful creation of srv. the program end immediatly. > > In my understanding, I supposed that I will never see the end message. > > > program tst; > > uses rpi_hal,SynHttpSrv,HttpSrvDemo1;
    > var srv:TSrvDatamodule;begin
> > srv:=TSrvDatamodule.create(nil);
    > writeln('end ');
    > end.
> > > -----Ursprüngliche Nachricht-----
    >     *Von:* Yury Sidorov <j...@cp-lab.com>
    >     *Gesendet:* Mon 12 Juni 2017 16:22
    >     *An:* synalist-public@lists.sourceforge.net
    >     *Betreff:* Re: [Synalist] HTTPS Server demo on debian and raspberry pi
> > See the HttpSrvDemo1.pas as an example of the web server.
    >     Use the InitHttps method to enable https.
> > The sources are quite simple, so it is easy to understand how it works. > > Yury Sidorov,
    >     j...@cp-lab.com
> > On 6/12/2017 1:49 PM, Stefan Fischer wrote:
    >     > Thanks Yuri,
> > > > now it compiles with FPC 3.0.0. > > > > How can I create a simple http(s) webserver, which serves htm files in local directory. Just need a hint to start with > > the code. > > > > Stefan > >
    
------------------------------------------------------------------------------
    Check out the vibrant tech community on one of the world's most
    engaging tech sites, Slashdot.org! http://sdm.link/slashdot
    _______________________________________________
    synalist-public mailing list
    synalist-public@lists.sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/synalist-public



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to