mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 09:42:57 +01:00
different ports
This commit is contained in:
parent
3adddc591d
commit
f737a3eb3e
@ -20,6 +20,12 @@ codecov = { repository = "fafhrd91/actix-web", branch = "master", service = "git
|
||||
name = "actix_web"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
# http/2
|
||||
http2 = ["h2"]
|
||||
|
||||
[dependencies]
|
||||
log = "0.3"
|
||||
time = "0.1"
|
||||
@ -40,10 +46,11 @@ futures = "0.1"
|
||||
tokio-core = "0.1"
|
||||
tokio-io = "0.1"
|
||||
tokio-proto = "0.1"
|
||||
h2 = { git = 'https://github.com/carllerche/h2', optional = true }
|
||||
|
||||
[dependencies.actix]
|
||||
#path = "../actix"
|
||||
git = "https://github.com/fafhrd91/actix.git"
|
||||
git = "https://github.com/actix/actix.git"
|
||||
#version = "0.2"
|
||||
default-features = false
|
||||
features = []
|
||||
|
@ -10,5 +10,5 @@ path = "src/main.rs"
|
||||
[dependencies]
|
||||
env_logger = "*"
|
||||
# actix = "0.2"
|
||||
actix = { git = "https://github.com/fafhrd91/actix.git" }
|
||||
actix = { git = "https://github.com/actix/actix.git" }
|
||||
actix-web = { path = "../../" }
|
||||
|
@ -24,6 +24,6 @@ serde = "1.0"
|
||||
serde_json = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
||||
actix = { git = "https://github.com/fafhrd91/actix.git" }
|
||||
actix = { git = "https://github.com/actix/actix.git" }
|
||||
# actix = { path = "../../../actix" }
|
||||
actix-web = { path = "../../" }
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Websocket chat example
|
||||
|
||||
This is extension of the
|
||||
[actix chat example](https://github.com/fafhrd91/actix/tree/master/examples/chat)
|
||||
[actix chat example](https://github.com/actix/actix/tree/master/examples/chat)
|
||||
|
||||
Added features:
|
||||
|
||||
|
@ -39,14 +39,14 @@ fn test_serve_incoming() {
|
||||
let sys = System::new("test");
|
||||
|
||||
let srv = create_server();
|
||||
let addr = net::SocketAddr::from_str("127.0.0.1:58906").unwrap();
|
||||
let addr = net::SocketAddr::from_str("127.0.0.1:58903").unwrap();
|
||||
let tcp = TcpListener::bind(&addr, Arbiter::handle()).unwrap();
|
||||
srv.serve_incoming::<_, ()>(tcp.incoming()).unwrap();
|
||||
sys.run();
|
||||
|
||||
});
|
||||
|
||||
assert!(reqwest::get("http://localhost:58906/").unwrap().status().is_success());
|
||||
assert!(reqwest::get("http://localhost:58903/").unwrap().status().is_success());
|
||||
}
|
||||
|
||||
struct MiddlewareTest {
|
||||
@ -94,11 +94,11 @@ fn test_middlewares() {
|
||||
httpcodes::HTTPOk
|
||||
}))
|
||||
.finish()])
|
||||
.serve::<_, ()>("127.0.0.1:58903").unwrap();
|
||||
.serve::<_, ()>("127.0.0.1:58904").unwrap();
|
||||
sys.run();
|
||||
});
|
||||
|
||||
assert!(reqwest::get("http://localhost:58903/").unwrap().status().is_success());
|
||||
assert!(reqwest::get("http://localhost:58904/").unwrap().status().is_success());
|
||||
|
||||
assert_eq!(num1.load(Ordering::Relaxed), 1);
|
||||
assert_eq!(num2.load(Ordering::Relaxed), 1);
|
||||
|
Loading…
Reference in New Issue
Block a user