Musixal / Backhaul

Lightning-fast reverse tunneling solution for NAT traversal, optimized for handling massive concurrent connections with tcp, tcpmux, ws, wsmux, wss and wssmux support.
https://gozar_xray.t.me
GNU Affero General Public License v3.0
159 stars 26 forks source link

Add enhanced port handling support #4

Closed sahmadiut closed 1 week ago

sahmadiut commented 2 weeks ago

This Pull Request introduces support for handling multiple port mapping formats, providing greater flexibility in port configurations:

These updates allow for more dynamic and flexible configuration of ports, making it easier to handle different use cases.

sahmadiut commented 1 week ago

Adding to the existing port mapping improvements, this update introduces support for two additional formats and enhances error handling:

New supported formats:

Key improvements:

Implemented regex-based parsing for more robust and flexible port mapping. Enhanced error management for invalid port mappings, providing better feedback and stability.

Musixal commented 1 week ago

Unfortunately, I haven't had a chance to read your PR yet. But I think that using regex reduces the readability of the code. Also, in my opinion, the format of a port range is better to be like this: 1001-1003. What we also see in HAProxy.

sahmadiut commented 1 week ago

Thank you for your feedback! I appreciate your point about readability