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

IP_TRANSPARENT socket option #1490

Closed
gunzino opened this issue Jun 14, 2024 · 0 comments
Closed

IP_TRANSPARENT socket option #1490

gunzino opened this issue Jun 14, 2024 · 0 comments

Comments

@gunzino
Copy link

gunzino commented Jun 14, 2024

Hello,

I'm working on adding transparent proxying support to our application based on Boost ASIO. To achieve this, Linux supports IP_TRANSPARENT socket option (option number 19). Based on docs, there is no current support for this in ASIO. Can you recommend some workaround (maybe using SettableSocketOption?) or are you planning to add this in the future?

Inspiration from this repo: https://github.com/cloudflare/mmproxy/

EDIT: Found inspiration in tcp_delay code which makes it clear how to implement this.

#include <sys/socket.h>
typedef boost::asio::detail::socket_option::boolean<IPPROTO_IP, IP_TRANSPARENT> ip_transparent_option;
typedef boost::asio::detail::socket_option::boolean<IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT> ip_bind_address_no_port_option;
typedef boost::asio::detail::socket_option::integer<SOL_SOCKET, SO_MARK> ip_mark_option;
@gunzino gunzino closed this as completed Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant