summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 2b4826f..f536d94 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,7 +16,8 @@ use std::process;
use std::thread;
use std::sync::mpsc;
-use hyper::Server;
+use hyper::{Client, Server, Request};
+use hyper::body::Body;
use hyper::service::service_fn;
use tokio::runtime::Runtime;
use futures::Future;
@@ -69,6 +70,28 @@ fn main() {
let mut rt = Runtime::new().unwrap();
rt.spawn(server);
+ let client = Client::new();
+
+ let req = Request::builder()
+ .method("POST")
+ .uri("http://10.5.1.201:38400/serviceControl/AVTransport")
+ .header("Content-Type", "text/xml")
+ .header("SOAPACTION", notify::A_SET)
+ .body(Body::from(notify::BODY_SET_URI))
+ .unwrap();
+
+ rt.spawn(client.request(req).map(|res| {}).map_err(|err| {}));
+
+ let req = Request::builder()
+ .method("POST")
+ .uri("http://10.5.1.201:38400/serviceControl/AVTransport")
+ .header("Content-Type", "text/xml")
+ .header("SOAPACTION", notify::A_PLAY)
+ .body(Body::from(notify::BODY_PLAY))
+ .unwrap();
+
+ rt.spawn(client.request(req).map(|res| {}).map_err(|err| {}));
+
// let _udp = thread::spawn(move || {
// upnp::discover();
// });