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

如何返回html页面? #3

Open
Yuanyiis opened this issue Sep 1, 2019 · 3 comments
Open

如何返回html页面? #3

Yuanyiis opened this issue Sep 1, 2019 · 3 comments

Comments

@Yuanyiis
Copy link

Yuanyiis commented Sep 1, 2019

您好,您的白名单系统非常棒。
想请问一下,不在白名单的域名现在直接发reset了。
如何不reset而是显示html内容呢?
想做个提示。。。
万分感谢!

@fifilyu
Copy link
Owner

fifilyu commented Sep 1, 2019

感谢鼓励^_^。Linux内核仅仅针对TCP的标志位做操作(比如设置为reset),无法满足直接返回HTTP协议数据包的场景。

如果需要返回HTTP协议数据包,需要对用户客户端(比如浏览器)发出的HTTP Request请求做响应(构造HTTP Response数据包)。因为,HTTP协议是TCP子协议,按照HTTP协议规则返回数据包就行了。

不过,我暂时没考虑增加返回HTTP数据包的功能,让浏览器显示友好的HTML网页。

据我所知,阿里云的白名单系统支持返回HTML。猜测阿里云应该是在TCP应用层(HTTP子协议层?)做的过滤,而不是在TCP网络层。

@Yuanyiis
Copy link
Author

Yuanyiis commented Sep 1, 2019

好的,明白啦,谢谢!

@xqpmjh
Copy link

xqpmjh commented Nov 16, 2022

感谢作者大大的 whitelist 案例,解决了燃眉之急!

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

3 participants