java或c#中的强制门户

时间:2021-08-05 03:37:45

I have been trying to write a captive portal in java but i don't know where to start, i have done researched on search engines but i haven't seen any tutorial on how to start. I don't need someone to write codes for me, all i need is a a way of making my server get all the HTTP request from the wifi adapter and reply with my custom landing page. I have tried setting up a ServerSocket but that does not solve my problem, What am looking for is a Socket to accept http connections and authenticate users. Answers can be posted in java or c#

我一直在尝试在java中编写一个强制网站,但我不知道从哪里开始,我已经在搜索引擎上进行了研究,但我还没有看到任何关于如何开始的教程。我不需要有人为我编写代码,我只需要一种让我的服务器从wifi适配器获取所有HTTP请求并使用我的自定义登录页面回复的方法。我试过设置一个ServerSocket,但这并没有解决我的问题,我们正在寻找的是一个接受http连接和验证用户的Socket。答案可以在java或c#中发布

2 个解决方案

#1


1  

you should create a DNS server. when network users sent request to reach IP of a specific host name; redirect them to your captive portal web service in a specific IP. obviously your DHCP shall be configured on your DNS server IP. you can use arsoft.tools.net in c# library to create your arbitrary DNS server. And also you can authorize users with a time limit or with username and password in your captive portal page.

你应该创建一个DNS服务器。当网络用户发送请求到达特定主机名的IP时;将它们重定向到特定IP中的强制门户Web服务。显然你的DHCP应该在你的DNS服务器IP上配置。您可以在c#库中使用arsoft.tools.net来创建任意DNS服务器。此外,您还可以在强制门户网站页面中为用户授予时间限制或用户名和密码。

#2


0  

The most known solution for this is using an OS with a great routing and firewall managers. After all you will have o manage the new incoming connections and properly manage them. You can read about well known pfSense, it's a great solution.

最着名的解决方案是使用具有出色路由和防火墙管理器的操作系统。毕竟,您将管理新的传入连接并正确管理它们。你可以阅读有关着名的pfSense,这是一个很好的解决方案。

A work around of this is using a software that connects directly to an server (via socket) and manage the new connection (client) of it's requests made by the client software.

解决此问题的方法是使用直接连接到服务器(通过套接字)的软件,并管理客户端软件发出的请求的新连接(客户端)。

#1


1  

you should create a DNS server. when network users sent request to reach IP of a specific host name; redirect them to your captive portal web service in a specific IP. obviously your DHCP shall be configured on your DNS server IP. you can use arsoft.tools.net in c# library to create your arbitrary DNS server. And also you can authorize users with a time limit or with username and password in your captive portal page.

你应该创建一个DNS服务器。当网络用户发送请求到达特定主机名的IP时;将它们重定向到特定IP中的强制门户Web服务。显然你的DHCP应该在你的DNS服务器IP上配置。您可以在c#库中使用arsoft.tools.net来创建任意DNS服务器。此外,您还可以在强制门户网站页面中为用户授予时间限制或用户名和密码。

#2


0  

The most known solution for this is using an OS with a great routing and firewall managers. After all you will have o manage the new incoming connections and properly manage them. You can read about well known pfSense, it's a great solution.

最着名的解决方案是使用具有出色路由和防火墙管理器的操作系统。毕竟,您将管理新的传入连接并正确管理它们。你可以阅读有关着名的pfSense,这是一个很好的解决方案。

A work around of this is using a software that connects directly to an server (via socket) and manage the new connection (client) of it's requests made by the client software.

解决此问题的方法是使用直接连接到服务器(通过套接字)的软件,并管理客户端软件发出的请求的新连接(客户端)。