4
webmachine에서 https를 사용할 수있는 권장 방법은 무엇입니까?http 및 https가있는 웹 컴퓨터?
mochiweb을 가져 오는 예제가 있습니다. working with https and http. 웹 메신저로 번역하는 것처럼 보일 수 있습니다. 특히 하나의 앱에서 http 및 https 요청을 어떻게 처리합니까?
webmachine에서 https를 사용할 수있는 권장 방법은 무엇입니까?http 및 https가있는 웹 컴퓨터?
mochiweb을 가져 오는 예제가 있습니다. working with https and http. 웹 메신저로 번역하는 것처럼 보일 수 있습니다. 특히 하나의 앱에서 http 및 https 요청을 어떻게 처리합니까?
데모 응용 프로그램에서 mywebdemo_sup.erl을 다음과 같이 변경하면 여러 개의 리스너를 얻는 데 성공했습니다. 나는 그것을 그 이상으로 테스트하지는 않았지만 당신을 시작하기에 충분할만큼 잘하면.
init([]) ->
Ip = case os:getenv("WEBMACHINE_IP") of false -> "0.0.0.0"; Any -> Any end,
{ok, Dispatch} = file:consult(filename:join(
[filename:dirname(code:which(?MODULE)),
"..", "priv", "dispatch.conf"])),
WebConfig = [
{name, one},
{ip, Ip},
{port, 8000},
{log_dir, "priv/log"},
{dispatch, Dispatch}],
Web = {one,
{webmachine_mochiweb, start, [WebConfig]},
permanent, 5000, worker, dynamic},
WebSSLConfig = [
{name, two},
{ip, Ip},
{port, 8443},
{ssl, true},
{ssl_opts, [{certfile, "/tmp/api_server.crt"},
{cacertfile,"tmp/api_server.ca.crt"},
{keyfile, "/tmp/api_server.key"}]},
{log_dir, "priv/log"},
{dispatch, Dispatch}],
WebSSL = {two,
{webmachine_mochiweb, start, [WebSSLConfig]},
permanent, 5000, worker, dynamic},
Processes = [Web, WebSSL],
{ok, { {one_for_one, 10, 10}, Processes} }.
대단히 감사드립니다. – noenzyme
매력처럼 작동합니다! 감사. – noenzyme