web

package
v1.2.3-beta2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package web 网络处理相关

Index

Constants

This section is empty.

Variables

View Source
var IsSupportIPv6 = func() bool {
	resp, err := http.Get("http://v6.ipv6-test.com/json/widgetdata.php?callback=?")
	if err != nil {
		logrus.Infoln("[web] 本机不支持ipv6")
		return false
	}
	_, _ = io.ReadAll(resp.Body)
	_ = resp.Body.Close()
	logrus.Infoln("[web] 本机支持ipv6")
	return true
}()

IsSupportIPv6 检查本机是否支持 ipv6

Functions

func GetData

func GetData(url string) (data []byte, err error)

GetData 获取数据

func ReqWith

func ReqWith(url string, method string, referer string, ua string) (data []byte, err error)

ReqWith 使用自定义请求头获取数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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