[racket] Serving http and https from the same server

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Tue May 29 14:36:18 EDT 2012

Ah yes sorry. I was thinking of a different function (serve)

You can do this by starting two servers in different threads, one with
#:ssl and one without

(thread (lambda () your code)))
(thread (lambda () your code minus ssl)))

and you'll get two servers sharing the same 'start' and the same state, etc.

Jay

On Tue, May 29, 2012 at 9:52 AM, Jordan Schatz <jordan at noionlabs.com> wrote:
>
> That doesn't seem to work for me, attached are the server I'm using for testing,
> a throw away cert and private key, and a test script to request the page over
> https and http.
>
> I am using Racket v5.3.0.9
>
> HTTPS is served fine, but the HTTP requests returns empty.
>
> Thanks,
> Jordan
>
>
>
>
> On Tue, 29 May 2012 00:52:37 -0600, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>> Yes, just use the #:ssl keywords to serve/servlet and the servlet will
>> be served from both HTTP and HTTPS.
>>
>> Jay
>>
>> On Mon, May 28, 2012 at 10:36 PM, Jordan Schatz <jordan at noionlabs.com> wrote:
>> >
>> > Is it possible to serve http and https from the same servlet?
>> >
>> > I would like to serve most of my application over SSL, but have a way to
>> > redirect people from http to https.
>> >
>> > - Jordan
>> > ____________________
>> >  Racket Users list:
>> >  http://lists.racket-lang.org/users
>>
>>
>>
>> --
>> Jay McCarthy <jay at cs.byu.edu>
>> Assistant Professor / Brigham Young University
>> http://faculty.cs.byu.edu/~jay
>>
>> "The glory of God is Intelligence" - D&C 93
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.