Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: docs++ #228

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mitmproxy-macos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ This package contains the following precompiled binaries for macOS:
## Redirector Development Setup

The macOS Network System Extension needs to be signed and notarized during development.
You need to reconfigure the XCode project to use your own (paid) Apple Developer Account.
You need to reconfigure the XCode project to use your own (paid) Apple Developer Account.

- Clicking "Build" in XCode should automatically install `/Applications/Mitmproxy Redirector.app`.
- Run mitmproxy with an `MITMPROXY_KEEP_REDIRECTOR=1` env var to keep the development version.
mitmproxy should start with "Using existing mitmproxy redirector app."
- ⚠️ Bump the network extension version on changes, otherwise existing installations will not be replaced
on upgrade, see https://github.com/mitmproxy/mitmproxy_rs/pull/227.
5 changes: 5 additions & 0 deletions mitmproxy-macos/redirector/ipc/mitmproxy_ipc.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ struct MitmproxyIpc_FromProxy: Sendable {
}

/// Packet (macOS UDP Stream)
/// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
struct MitmproxyIpc_Packet: @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
Expand All @@ -125,6 +126,7 @@ struct MitmproxyIpc_Packet: @unchecked Sendable {
}

/// Intercept conf (macOS Control Stream)
/// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
struct MitmproxyIpc_InterceptConf: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
Expand All @@ -138,6 +140,7 @@ struct MitmproxyIpc_InterceptConf: Sendable {
}

/// New flow (macOS TCP/UDP Stream)
/// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
struct MitmproxyIpc_NewFlow: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
Expand Down Expand Up @@ -172,6 +175,7 @@ struct MitmproxyIpc_NewFlow: Sendable {
init() {}
}

/// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
struct MitmproxyIpc_TcpFlow: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
Expand Down Expand Up @@ -203,6 +207,7 @@ struct MitmproxyIpc_TcpFlow: Sendable {
fileprivate var _tunnelInfo: MitmproxyIpc_TunnelInfo? = nil
}

/// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
struct MitmproxyIpc_UdpFlow: Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
Expand Down
5 changes: 5 additions & 0 deletions src/ipc/mitmproxy_ipc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,29 @@ message FromProxy {
}
}
// Packet (macOS UDP Stream)
// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
message Packet {
bytes data = 1;
}
// Intercept conf (macOS Control Stream)
// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
message InterceptConf {
repeated string actions = 1;
}
// New flow (macOS TCP/UDP Stream)
// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
message NewFlow {
oneof message {
TcpFlow tcp = 1;
UdpFlow udp = 2;
}
}
// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
message TcpFlow {
Address remote_address = 1;
TunnelInfo tunnel_info = 2;
}
// ⚠️ Bump network extension version on changes, https://github.com/mitmproxy/mitmproxy_rs/pull/227.
message UdpFlow {
optional Address local_address = 1;
TunnelInfo tunnel_info = 3;
Expand Down
5 changes: 5 additions & 0 deletions src/ipc/mitmproxy_ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ pub mod from_proxy {
}
}
/// Packet (macOS UDP Stream)
/// ⚠️ Bump network extension version on changes, <https://github.com/mitmproxy/mitmproxy_rs/pull/227.>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Packet {
#[prost(bytes = "bytes", tag = "1")]
pub data: ::prost::bytes::Bytes,
}
/// Intercept conf (macOS Control Stream)
/// ⚠️ Bump network extension version on changes, <https://github.com/mitmproxy/mitmproxy_rs/pull/227.>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InterceptConf {
#[prost(string, repeated, tag = "1")]
pub actions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// New flow (macOS TCP/UDP Stream)
/// ⚠️ Bump network extension version on changes, <https://github.com/mitmproxy/mitmproxy_rs/pull/227.>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NewFlow {
#[prost(oneof = "new_flow::Message", tags = "1, 2")]
Expand All @@ -64,13 +67,15 @@ pub mod new_flow {
Udp(super::UdpFlow),
}
}
/// ⚠️ Bump network extension version on changes, <https://github.com/mitmproxy/mitmproxy_rs/pull/227.>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TcpFlow {
#[prost(message, optional, tag = "1")]
pub remote_address: ::core::option::Option<Address>,
#[prost(message, optional, tag = "2")]
pub tunnel_info: ::core::option::Option<TunnelInfo>,
}
/// ⚠️ Bump network extension version on changes, <https://github.com/mitmproxy/mitmproxy_rs/pull/227.>
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UdpFlow {
#[prost(message, optional, tag = "1")]
Expand Down
Loading