Fix "inbound-http" feature (#323)
This commit is contained in:
@@ -59,7 +59,7 @@ impl InboundStreamHandler for Handler {
|
||||
&'a self,
|
||||
mut sess: Session,
|
||||
stream: Box<dyn ProxyStream>,
|
||||
) -> std::io::Result<InboundTransport> {
|
||||
) -> std::io::Result<AnyInboundTransport> {
|
||||
let http = Http::new();
|
||||
let proxy_service = ProxyService::new();
|
||||
let conn = http
|
||||
@@ -99,9 +99,6 @@ impl InboundStreamHandler for Handler {
|
||||
|
||||
sess.destination = destination;
|
||||
|
||||
Ok(InboundTransport::Stream(
|
||||
Box::new(SimpleProxyStream(parts.io)),
|
||||
sess,
|
||||
))
|
||||
Ok(InboundTransport::Stream(Box::new(parts.io), sess))
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,8 @@ impl<'a> SimpleCallback<'a> {
|
||||
impl<'a> Callback for SimpleCallback<'a> {
|
||||
fn on_request(self, request: &Request, response: Response) -> Result<Response, ErrorResponse> {
|
||||
if request.uri().path() != self.path {
|
||||
return Err(http::response::Response::builder()
|
||||
.status(http::StatusCode::NOT_FOUND)
|
||||
return Err(::http::response::Response::builder()
|
||||
.status(::http::StatusCode::NOT_FOUND)
|
||||
.body(None)
|
||||
.unwrap());
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ impl<'a> tungstenite::client::IntoClientRequest for Request<'a> {
|
||||
fn into_client_request(
|
||||
self,
|
||||
) -> tungstenite::error::Result<tungstenite::handshake::client::Request> {
|
||||
let mut builder = http::Request::builder()
|
||||
let mut builder = ::http::Request::builder()
|
||||
.method("GET")
|
||||
.uri(self.uri)
|
||||
.header("User-Agent", &*crate::option::HTTP_USER_AGENT);
|
||||
|
||||
Reference in New Issue
Block a user