user_agent_parse

package module
v0.0.0-...-86c1c5a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

README

UserAgent Parser

This Caddy Module allows to parse the user agent and provides essential device and bot detection.

You can access the information via this placeholder:

  • {user_agent.type} - Type string with possible values: bot, mobile, tablet, desktop

Priority: Bot detection has priority over device type. If a bot is detected, the type will be bot regardless of the device.

The module uses the parser from here.

Install

First, the xcaddy command:

$ go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest

Then build Caddy with this Go module plugged in. For example:

$ xcaddy build --with github.com/neodyme-labs/influx_log

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserAgentParse

type UserAgentParse struct {
	// contains filtered or unexported fields
}

func (UserAgentParse) CaddyModule

func (UserAgentParse) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*UserAgentParse) Provision

func (l *UserAgentParse) Provision(ctx caddy.Context) error

func (*UserAgentParse) ServeHTTP

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL