mirror of
https://github.com/jorisvink/kore
synced 2025-03-10 13:09:02 -04:00
56 lines
1012 B
Plaintext
56 lines
1012 B
Plaintext
# python configuration
|
|
|
|
load ./python.so onload
|
|
|
|
# import both python modules.
|
|
python_import src/index.py onload
|
|
python_import src/websockets.py
|
|
|
|
bind 127.0.0.1 8888
|
|
|
|
tls_dhparam dh2048.pem
|
|
|
|
validator v_id function c_validator
|
|
validator v_p_id function python_validator
|
|
validator v_auth function python_auth
|
|
|
|
websocket_maxframe 65536
|
|
websocket_timeout 20
|
|
|
|
authentication auth {
|
|
authentication_type request
|
|
authentication_validator v_auth
|
|
}
|
|
|
|
domain * {
|
|
certfile cert/server.crt
|
|
certkey cert/server.key
|
|
|
|
# Mix page handlers between native and python.
|
|
static / page
|
|
static /c cpage
|
|
static /b minimal
|
|
static /json json_parse
|
|
static /state state_test
|
|
static /ws ws_connect
|
|
|
|
# Use the builtin asset_serve_* to serve frontend HTML.
|
|
static /wspage asset_serve_frontend_html
|
|
|
|
static /auth page auth
|
|
|
|
#
|
|
# On the native page handler, use a python validator.
|
|
#
|
|
params get /c {
|
|
validate id v_p_id
|
|
}
|
|
|
|
#
|
|
# On the python page handler, use a native validator.
|
|
#
|
|
params get / {
|
|
validate id v_id
|
|
}
|
|
}
|