Fix #216 packets get mangled when handling multiple connections
This commit is contained in:
parent
365ddd7875
commit
cab43376e8
4 changed files with 47 additions and 45 deletions
|
@ -116,10 +116,11 @@ pub async fn connect(
|
|||
&client_cfg.http_upgrade_path_prefix
|
||||
))
|
||||
.header(COOKIE, tunnel_to_jwt_token(request_id, dest_addr))
|
||||
.header(CONTENT_TYPE, "application/grpc+proto")
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.version(hyper::Version::HTTP_2);
|
||||
|
||||
for (k, v) in &client_cfg.http_headers {
|
||||
let _ = req.headers_mut().unwrap().remove(k);
|
||||
req = req.header(k, v);
|
||||
}
|
||||
if let Some(auth) = &client_cfg.http_upgrade_credentials {
|
||||
|
|
|
@ -17,7 +17,7 @@ use std::io;
|
|||
use std::io::ErrorKind;
|
||||
use std::ops::DerefMut;
|
||||
use tokio::io::{AsyncWrite, AsyncWriteExt, ReadHalf, WriteHalf};
|
||||
use tracing::trace;
|
||||
use tracing::{error, trace};
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct WebsocketTunnelWrite {
|
||||
|
@ -104,7 +104,7 @@ impl WebsocketTunnelRead {
|
|||
}
|
||||
|
||||
fn frame_reader(x: Frame<'_>) -> futures_util::future::Ready<anyhow::Result<()>> {
|
||||
debug!("frame {:?} {:?}", x.opcode, x.payload);
|
||||
error!("frame {:?} {:?}", x.opcode, x.payload);
|
||||
futures_util::future::ready(anyhow::Ok(()))
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,7 @@ pub async fn connect(
|
|||
.version(hyper::Version::HTTP_11);
|
||||
|
||||
for (k, v) in &client_cfg.http_headers {
|
||||
let _ = req.headers_mut().unwrap().remove(k);
|
||||
req = req.header(k, v);
|
||||
}
|
||||
if let Some(auth) = &client_cfg.http_upgrade_credentials {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue