Add ws-max-paxload (#155)

This commit is contained in:
rakita
2020-12-09 11:48:27 +01:00
committed by draganrakita
parent f9f536cd08
commit 8f794afdb5
5 changed files with 15 additions and 0 deletions

View File

@@ -223,6 +223,7 @@ pub fn start_ws<M, S, H, T, U, V>(
extractor: T,
middleware: V,
stats: U,
max_payload: usize,
) -> Result<ws::Server, ws::Error>
where
M: jsonrpc_core::Metadata,
@@ -237,6 +238,7 @@ where
.allowed_origins(allowed_origins)
.allowed_hosts(allowed_hosts)
.max_connections(max_connections)
.max_payload(max_payload * 1024 * 1024)
.session_stats(stats)
.start(addr)
}

View File

@@ -44,6 +44,7 @@ pub fn serve() -> (Server<ws::Server>, usize, GuardedAuthCodes) {
extractors::WsExtractor::new(Some(&authcodes.path)),
extractors::WsExtractor::new(Some(&authcodes.path)),
extractors::WsStats::new(stats),
5 * 1024 * 1024,
)
.unwrap()
});