From: Nishi Date: Tue, 1 Oct 2024 23:05:34 +0000 (+0000) Subject: allow https X-Git-Url: https://git.chaotic.ninja/gitweb/nishi/?a=commitdiff_plain;h=18ca731c318cc025c6f2fbc9d654162bfb77d2cd;p=koakuma.git allow https git-svn-id: file:///raid/svn-personal/koakuma/trunk@8 219d0f9c-2d94-d447-890a-813e76b88fe9 --- diff --git a/Tool/create-project.in b/Tool/create-project.in index 76d5d3a..5c6577c 100644 --- a/Tool/create-project.in +++ b/Tool/create-project.in @@ -1,7 +1,6 @@ #!/usr/bin/env tclsh # $Id$ package require tdom -set RPC_URL "http://127.0.0.1/koakuma/rpc" foreach arg $argv { if { [string range "$arg" 0 0] == "-" } { if { "$arg" == "-h" || "$arg" == "--help" } { @@ -15,10 +14,6 @@ foreach arg $argv { foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] { source $path } -if { [info exists "env(KOAKUMA_RPC)"] } { - set RPC_URL "$env(KOAKUMA_RPC)" -} -set RPC_URL "[regsub {/+$} "$RPC_URL" ""]" puts -nonewline "Authentication: " set status [::rpc::require-auth] if { $status == 1 } { diff --git a/Utility/rpc.tcl b/Utility/rpc.tcl index 16fa0fc..849cb64 100644 --- a/Utility/rpc.tcl +++ b/Utility/rpc.tcl @@ -3,6 +3,17 @@ package require http package require base64 package require term::ansi::ctrl::unix +catch { + package require tls + ::http::register https 443 ::tls::socket +} + +set RPC_URL "http://127.0.0.1/koakuma/rpc" +if { [info exists "env(KOAKUMA_RPC)"] } { + set RPC_URL "$env(KOAKUMA_RPC)" +} +set RPC_URL "[regsub {/+$} "$RPC_URL" ""]" + namespace eval rpc { proc require-auth {} { global RPC_URL