
The highest tagged major version is
v6.
package
Version:
v1.6.0
Opens a new window with list of versions in this module.
Published: Jun 15, 2019
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package host 提供了限定访问域名的中间件。
New 声明一个限定域名的中间件.
若请求的域名不允许,会返回 404 错误。
若 domains 为空,则任何请求都将返回 404。
仅会将域名与 domains 进行比较,端口与协议都将不参写比较。
domains 可以是泛域名,比如 *.example.com,但不能是 s1.*.example.com
Switcher 实现按域名进行路由
NewSwitcher 声明新的 Switcher 实例
AddHost 添加域名信息
domain 可以是泛域名,比如 *.example.com,但不能是 s1.*.example.com
Source Files
¶
Directories
¶
Package switcher 按域名进行路由分类
|
Package switcher 按域名进行路由分类 |
Click to show internal directories.
Click to hide internal directories.