Skip to content

Commit

Permalink
fix: outbound socket_type should be TCP when fail to match proxy rules
Browse files Browse the repository at this point in the history
  • Loading branch information
micooz committed Jan 29, 2022
1 parent 4c4df6c commit 70ee901
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bp-core/src/net/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,12 @@ impl Connection {

self.dest_addr = Some(resolved.address.clone());

// set outbound socket type
self.outbound.set_socket_type(self.get_outbound_socket_type(resolved));

// check proxy rules then create outbound protocol
let mut out_proto = if self.check_proxy_rules() {
self.outbound.set_socket_type(self.get_outbound_socket_type(resolved));
self.create_outbound_protocol(resolved)
} else {
self.outbound.set_socket_type(SocketType::Tcp);
self.outbound.set_allow_proxy(false);
Box::new(Direct::default())
};
Expand Down

0 comments on commit 70ee901

Please sign in to comment.