-
This commit is contained in:
@@ -116,6 +116,7 @@
|
||||
[request-count #:mutable]
|
||||
[sec-token-cache #:mutable]
|
||||
[cert-ou-token #:mutable]
|
||||
[context #:mutable]
|
||||
)
|
||||
#:transparent)
|
||||
|
||||
@@ -225,10 +226,13 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((f1 "c:/tmp/my.crt")
|
||||
(f2 "c:/tmp/my.key")
|
||||
(fh1 (open-output-file f1 #:exists 'replace))
|
||||
(fh2 (open-output-file f2 #:exists 'replace)))
|
||||
(let* ((cert-path (let ((p (build-path (find-system-path 'pref-dir) "racket-webview" (wv-context h))))
|
||||
(make-directory* p)
|
||||
p))
|
||||
(f1 (build-path cert-path "self-signed.cert"))
|
||||
(f2 (build-path cert-path "self-signed.key"))
|
||||
(fh1 (open-output-file f1 #:exists 'replace #:permissions #o600))
|
||||
(fh2 (open-output-file f2 #:exists 'replace #:permissions #o600)))
|
||||
(display (certificate cert) fh1)
|
||||
(display (private-key cert) fh2)
|
||||
(close-output-port fh1)
|
||||
@@ -353,11 +357,14 @@
|
||||
;; Webview functions
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define (webview-create file-getter event-callback
|
||||
#:boilerplate-js [bj (λ () (default-boilerplate-js))]
|
||||
#:parent [p #f])
|
||||
(define/contract (webview-create context file-getter event-callback
|
||||
#:boilerplate-js [bj (λ () (default-boilerplate-js))]
|
||||
#:parent [p #f])
|
||||
(->* ((or/c symbol? string?) procedure? procedure?)
|
||||
(#:boilerplate-js procedure? #:parent (or/c wv? #f))
|
||||
wv?)
|
||||
(let* ((h (make-wv #f 0 -1 file-getter bj #f 0 (make-lru 250 #:cmp eq?)
|
||||
(symbol->string (make-security-token))))
|
||||
(symbol->string (make-security-token)) (symbol->string context)))
|
||||
(cert (generate-self-signed-cert 2048 365 '("127.0.0.1" "localhost")
|
||||
"NL" "Dijkema"
|
||||
#:ou (wv-cert-ou-token h)))
|
||||
@@ -771,7 +778,7 @@
|
||||
(define (test)
|
||||
(let* ((cb (λ (handle evt)
|
||||
(displayln evt)))
|
||||
(h (webview-create file-getter cb))
|
||||
(h (webview-create 'test file-getter cb))
|
||||
)
|
||||
(webview-set-title! h "This is a test window")
|
||||
(webview-resize h 800 600)
|
||||
|
||||
Reference in New Issue
Block a user