mirror of https://github.com/mastodon/flodgatt
Merge branch 'master' of github.com:tootsuite/ragequit
This commit is contained in:
commit
5b9feda94e
|
@ -404,7 +404,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flodgatt"
|
name = "flodgatt"
|
||||||
version = "0.4.4"
|
version = "0.4.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"dotenv 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"dotenv 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "flodgatt"
|
name = "flodgatt"
|
||||||
description = "A blazingly fast drop-in replacement for the Mastodon streaming api server"
|
description = "A blazingly fast drop-in replacement for the Mastodon streaming api server"
|
||||||
version = "0.4.4"
|
version = "0.4.5"
|
||||||
authors = ["Daniel Long Sockwell <daniel@codesections.com", "Julian Laubstein <contact@julianlaubstein.de>"]
|
authors = ["Daniel Long Sockwell <daniel@codesections.com", "Julian Laubstein <contact@julianlaubstein.de>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
10
src/main.rs
10
src/main.rs
|
@ -1,5 +1,5 @@
|
||||||
use flodgatt::{
|
use flodgatt::{
|
||||||
config, dbg_and_die, err,
|
config, err,
|
||||||
parse_client_request::{sse, user, ws},
|
parse_client_request::{sse, user, ws},
|
||||||
redis_to_client_stream::{self, ClientAgent},
|
redis_to_client_stream::{self, ClientAgent},
|
||||||
};
|
};
|
||||||
|
@ -89,8 +89,12 @@ fn main() {
|
||||||
|
|
||||||
let health = warp::path!("api" / "v1" / "streaming" / "health").map(|| "OK");
|
let health = warp::path!("api" / "v1" / "streaming" / "health").map(|| "OK");
|
||||||
|
|
||||||
if let Some(_socket) = cfg.unix_socket.0.as_ref() {
|
if let Some(socket) = &*cfg.unix_socket {
|
||||||
dbg_and_die!("Unix socket support not yet implemented");
|
warn!("Using Unix sockets is a WIP that is currently unsupported and untested.");
|
||||||
|
std::fs::remove_file(socket).unwrap();
|
||||||
|
use tokio::net::UnixListener;
|
||||||
|
let incoming = UnixListener::bind(socket).unwrap().incoming();
|
||||||
|
warp::serve(health.or(websocket_routes.or(sse_routes).with(cors))).run_incoming(incoming);
|
||||||
} else {
|
} else {
|
||||||
warp::serve(health.or(websocket_routes.or(sse_routes).with(cors))).run(server_addr);
|
warp::serve(health.or(websocket_routes.or(sse_routes).with(cors))).run(server_addr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue