Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

CryptoNyaRu/GoPing

 
 

Repository files navigation

修复原库绑定网络接口无效的问题

  • 创建 Pinger 实例需要提供网络接口的名称: 固定使用该网络接口第一个 IPv4 地址, 优先使用该网络接口第一个掩码为 128 的 IPv6 地址
  • 发送 ICMP 包: 使用 FlagInterface 与 ControlMessage, 确保出包经过 Pinger 实例的网络接口
  • 接收 ICMP 包: 仅监听 Pinger 实例的网络接口地址, 避免多网络接口环境下回包混乱

go-ping

GoDoc Build Status Codecov Go Report Card

A simple ICMP Echo implementation, based on golang.org/x/net/icmp.

Features

  • IPv4 and IPv6 support
  • Unicast and multicast support
  • configurable retry amount and timeout duration
  • configurable payload size (and content)
  • round trip time measurement

Contribute

Simply fork and create a pull-request. We'll try to respond in a timely fashion.

License

MIT License, Copyright (c) 2018 Digineo GmbH

https://www.digineo.de

About

可指定网络接口的 ICMP Ping 库

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%