YYVPN icon indicating copy to clipboard operation
YYVPN copied to clipboard

VPN 请教

Open yanghl opened this issue 3 years ago • 5 comments

您好! 我按照你的教程 跑通了程序 但也正如你文章中所写, 所有app无法上网了,

请问如果要将 请求发送给真正的服务器, 相关逻辑如何实现呢?

是否可以将转发真正服务器的代码 传一下嘞 😄

谢谢 🙏

yanghl avatar Nov 04 '21 12:11 yanghl

那套程序只是说明原理的,服务器这块的转发代码我也没写。。

2021年11月4日 下午8:18,yanghl @.***> 写道:

您好! 我按照你的教程 跑通了程序 但也正如你文章中所写, 所有app无法上网了,

请问如果要将 请求发送给真正的服务器, 相关逻辑如何实现呢?

是否可以将转发真正服务器的代码 传一下嘞 😄

谢谢 🙏

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cgcym1234/YYVPN/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEEKYILFG2H4O3TPAYCUA3UKJ2ZDANCNFSM5HLJSAOQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

cgcym1234 avatar Nov 04 '21 12:11 cgcym1234

方便加个微信呗 咨询一些原理性的知识 感谢 🙏。我把微信通过简书私信 发您

yanghl avatar Nov 04 '21 12:11 yanghl

楼主这个还有些问题, 代理的是ip报文, 服务端需要创建虚拟网卡, 才能把ip报文发到真实的网络里, 但是Mac好像不支持这么做, 服务端得运行到linux之类的机器才行。

cocos543 avatar Nov 09 '21 09:11 cocos543

是的,只是说明原理,服务器那块没做真正的转发

cgcym1234 avatar Nov 09 '21 10:11 cgcym1234

把 IP 报文发送到服务端,服务端把报文 forward 到真实访问的远端服务器,得到返回的 IP 报文后再返回给client,client 再 write 到 tunnel 的虚拟网卡中

mike1023 avatar Dec 25 '23 08:12 mike1023