add #:tcp@ to ws-serve for wss: support
This commit is contained in:
parent
b686cc84a9
commit
11f2653b7e
|
@ -6,6 +6,7 @@
|
||||||
web-server/http
|
web-server/http
|
||||||
racket/list
|
racket/list
|
||||||
racket/async-channel
|
racket/async-channel
|
||||||
|
(prefix-in raw: (for-label net/tcp-unit))
|
||||||
net/websocket
|
net/websocket
|
||||||
net/websocket/client
|
net/websocket/client
|
||||||
net/websocket/server
|
net/websocket/server
|
||||||
|
@ -46,6 +47,7 @@ This module also provides the exports from @racketmodname[net/websocket/conn].
|
||||||
conn-headers
|
conn-headers
|
||||||
(bytes? (listof header?) . -> . (values (listof header?) any/c))
|
(bytes? (listof header?) . -> . (values (listof header?) any/c))
|
||||||
(λ (b hs) (values empty (void)))]
|
(λ (b hs) (values empty (void)))]
|
||||||
|
[#:tcp@ tcp@ (unit/c (import) (export tcp^)) raw:tcp@]
|
||||||
[#:port port tcp-listen-port? 80]
|
[#:port port tcp-listen-port? 80]
|
||||||
[#:listen-ip listen-ip (or/c string? false/c) #f]
|
[#:listen-ip listen-ip (or/c string? false/c) #f]
|
||||||
[#:max-waiting max-waiting integer? 4]
|
[#:max-waiting max-waiting integer? 4]
|
||||||
|
@ -64,6 +66,7 @@ This module also provides the exports from @racketmodname[net/websocket/conn].
|
||||||
|
|
||||||
All other arguments are used as in a @secref["dispatch-server-unit" #:doc '(lib "web-server/scribblings/web-server-internal.scrbl")].
|
All other arguments are used as in a @secref["dispatch-server-unit" #:doc '(lib "web-server/scribblings/web-server-internal.scrbl")].
|
||||||
|
|
||||||
|
The @racket[#:tcp@] keyword is provided for building an SSL server.
|
||||||
}
|
}
|
||||||
|
|
||||||
This module also provides the exports from @racketmodname[net/websocket/conn].
|
This module also provides the exports from @racketmodname[net/websocket/conn].
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
web-server/http/request-structs
|
web-server/http/request-structs
|
||||||
racket/async-channel
|
racket/async-channel
|
||||||
unstable/contract
|
unstable/contract
|
||||||
|
net/tcp-sig
|
||||||
|
(prefix-in raw: net/tcp-unit)
|
||||||
net/websocket/conn
|
net/websocket/conn
|
||||||
net/websocket/handshake)
|
net/websocket/handshake)
|
||||||
(provide (except-out (all-from-out net/websocket/conn) ws-conn))
|
(provide (except-out (all-from-out net/websocket/conn) ws-conn))
|
||||||
|
@ -16,6 +18,8 @@
|
||||||
(->* ((open-ws-conn? any/c . -> . void))
|
(->* ((open-ws-conn? any/c . -> . void))
|
||||||
(#:conn-headers
|
(#:conn-headers
|
||||||
(bytes? (listof header?) . -> . (values (listof header?) any/c))
|
(bytes? (listof header?) . -> . (values (listof header?) any/c))
|
||||||
|
#:tcp@
|
||||||
|
(unit/c (import) (export tcp^))
|
||||||
#:port
|
#:port
|
||||||
tcp-listen-port?
|
tcp-listen-port?
|
||||||
#:listen-ip
|
#:listen-ip
|
||||||
|
@ -30,6 +34,7 @@
|
||||||
|
|
||||||
(define (ws-serve conn-dispatch
|
(define (ws-serve conn-dispatch
|
||||||
#:conn-headers [pre-conn-dispatch (λ (cline hs) (values empty (void)))]
|
#:conn-headers [pre-conn-dispatch (λ (cline hs) (values empty (void)))]
|
||||||
|
#:tcp@ [tcp@ raw:tcp@]
|
||||||
#:port [port 80]
|
#:port [port 80]
|
||||||
#:listen-ip [listen-ip #f]
|
#:listen-ip [listen-ip #f]
|
||||||
#:max-waiting [max-waiting 4]
|
#:max-waiting [max-waiting 4]
|
||||||
|
@ -71,5 +76,14 @@
|
||||||
|
|
||||||
(conn-dispatch conn state))
|
(conn-dispatch conn state))
|
||||||
|
|
||||||
(define-values/invoke-unit/infer dispatch-server@)
|
(define-unit-binding a-tcp@
|
||||||
|
tcp@ (import) (export tcp^))
|
||||||
|
(define-compound-unit/infer dispatch-server@/tcp@
|
||||||
|
(import dispatch-server-config^)
|
||||||
|
(link a-tcp@ dispatch-server@)
|
||||||
|
(export dispatch-server^))
|
||||||
|
(define-values/invoke-unit
|
||||||
|
dispatch-server@/tcp@
|
||||||
|
(import dispatch-server-config^)
|
||||||
|
(export dispatch-server^))
|
||||||
(serve #:confirmation-channel confirm-ch))
|
(serve #:confirmation-channel confirm-ch))
|
Loading…
Reference in New Issue
Block a user