Fixing ip

pull/158/head
Dessalines 2019-05-01 16:00:26 -07:00
parent ea6b64f9fd
commit b2d8bf304e
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ fn chat_route(req: &HttpRequest<WsChatSessionState>) -> Result<HttpResponse, Err
WSSession {
id: 0,
hb: Instant::now(),
ip: req.connection_info().host().to_string(),
ip: req.connection_info().remote().unwrap_or("127.0.0.1:12345").split(":").next().unwrap_or("127.0.0.1").to_string()
},
)
}