Bind globally
This commit is contained in:
parent
63aea46079
commit
d72ae99bfc
|
@ -16,7 +16,7 @@ fn main() {
|
||||||
|
|
||||||
let http_state = Arc::clone(&state);
|
let http_state = Arc::clone(&state);
|
||||||
let http_thread = thread::spawn(move || {
|
let http_thread = thread::spawn(move || {
|
||||||
rouille::start_server("127.0.0.1:8005", move |request| {
|
rouille::start_server("0.0.0.0:8005", move |request| {
|
||||||
http::http_handler(request, &http_state)
|
http::http_handler(request, &http_state)
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,7 @@ use mailparse::{parse_mail, MailHeaderMap, ParsedMail};
|
||||||
use std::net::{TcpListener, TcpStream};
|
use std::net::{TcpListener, TcpStream};
|
||||||
|
|
||||||
pub fn start_server(state: State) {
|
pub fn start_server(state: State) {
|
||||||
let listener = TcpListener::bind("127.0.0.1:25").unwrap();
|
let listener = TcpListener::bind("0.0.0.0:25").unwrap();
|
||||||
|
|
||||||
for stream in listener.incoming() {
|
for stream in listener.incoming() {
|
||||||
match stream {
|
match stream {
|
||||||
|
|
Loading…
Reference in New Issue