Mahdi-zarei / nekoray

Qt based cross-platform GUI proxy configuration manager (backend: sing-box)
GNU General Public License v3.0
250 stars 17 forks source link

希望可以像这样根据入站标签来判断出站 #53

Open btaskel opened 1 week ago

btaskel commented 1 week ago

描述建议

希望可以像这样根据入站标签来判断出站

 "rules": [
        {
            "inbound": [
                "socks",
                "http"
            ],
            "outbound": "proxy"
        }
]

建议的必要性

图形化界面似乎并没有提供这样的入口,我尝试过直接编辑config里面的json文件,但是会不出所料的报错。 根据入站标签来判断出站,可以使需要代理的大流量软件不走路由,这样或许可以降低功耗和提高性能。

Mahdi-zarei commented 6 days ago

不好意思,我没太理解您的意思。我们目前没有自定义 inbounds 的选项,为其添加路由规则能起到什么作用呢?

btaskel commented 6 days ago

不好意思,我没太理解您的意思。我们目前没有自定义 inbounds 的选项,为其添加路由规则能起到什么作用呢?

这个功能可以让需要代理服务器的软件直接走代理服务器,我认为可以规避一些不必要的路由规则,从而提高性能、降低设备的功耗(尤其对移动设备)。

我每个月大约会在移动设备上使用近500GB的流量,这可能对我(我这类人群)的设备续航会很有帮助,谢谢你!

This feature allows software that requires a proxy server to directly use the proxy server. I believe it can bypass some unnecessary routing rules, thereby improving performance and reducing device power consumption (especially for mobile devices).

I use nearly 500GB of data on my mobile devices each month, which might significantly help with the battery life of my devices (and for people like me). Thank you!😊

Mahdi-zarei commented 6 days ago

This feature allows software that requires a proxy server to directly use the proxy server. I believe it can bypass some unnecessary routing rules, thereby improving performance and reducing device power consumption (especially for mobile devices).

Um, nekoray is not available for mobile devices, besides, routing rules almost consume no resources, they are simply checked on whenever a new connection or packet arrives to decide where the connection or packet should be delivered to, and this process is pretty light weight and is negligible. On mobile devices I suggest you use TCP based protocols and avoid UDP ones, also setting the TUN MTU to 9000 might help a bit.

btaskel commented 6 days ago

This feature allows software that requires a proxy server to directly use the proxy server. I believe it can bypass some unnecessary routing rules, thereby improving performance and reducing device power consumption (especially for mobile devices).

Um, nekoray is not available for mobile devices, besides, routing rules almost consume no resources, they are simply checked on whenever a new connection or packet arrives to decide where the connection or packet should be delivered to, and this process is pretty light weight and is negligible. On mobile devices I suggest you use TCP based protocols and avoid UDP ones, also setting the TUN MTU to 9000 might help a bit.

Mobile devices include laptops, and I will try using TCP instead of UDP. Thank you for your answer. Wishing you a wonderful day😊

btaskel commented 5 hours ago

I apologize for bothering you again. I want to try using different routing rules based on different inbound tags. For example, I want apps like Tor and Telegram to go directly through a proxy, but their IP addresses are not fixed. Therefore, I want to use inbound traffic to determine which proxy to use. Is there another way to achieve this in Nekoray?

Mahdi-zarei commented 5 hours ago

Since nekoray has a single inbound for proxying, you cannot achieve anything further using routing based on inbound tags. But Nekoray opens a mixed proxy port on the specified port (2080 by default) and you can configure telegram to use a proxy on your machine, I am currently doing this myself so that telegram is always connected whether system proxy or tun mode is used or not. As for tor, I assume you can also specify the proxy settings of it to use the proxy server of nekoray ( if ran on the same device it should be 127.0.0.1:(port) ) and then tor will use nekoray as long as it is up and running and won't need system proxy. This is as far as I know the easiest way to proxy your apps through nekoray while system proxy is not on. Also note that to use the proxy nekoray runs on your device on another device, you can use Allow other devices to connect and then other devices can use the proxy ( you will have to set their proxy to Ip-of-your-machine:port ).