fix-sse-protocol
This commit is contained in:
parent
6c0f84749e
commit
bf442e01c9
|
@ -1,4 +1,3 @@
|
|||
# sigil ver 2.2 dufok 2022-10-15 (with location /connect nobuffer)
|
||||
# Proxy settings
|
||||
{{ $proxy_settings := "proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_set_header Host $http_host; proxy_set_header X-Request-Start $msec;" }}
|
||||
# GZIP settings
|
||||
|
|
|
@ -128,7 +128,10 @@ async fn connect_handler(
|
|||
let server_event_stream = futures::stream::unfold(rx, |mut rx| async {
|
||||
let result = rx.recv().await;
|
||||
match result {
|
||||
Ok(server_event) => Some((Ok::<_, actix_web::Error>(Bytes::from(server_event)), rx)),
|
||||
Ok(server_event) => {
|
||||
let formatted_server_event = format!("data: {}\n\n", server_event);
|
||||
Some((Ok::<_, actix_web::Error>(Bytes::from(formatted_server_event)), rx))
|
||||
},
|
||||
Err(_) => None,
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user