netUtils

package
v0.0.0-...-5746ace Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForwardPortIfNeeded

func ForwardPortIfNeeded(vmIp string, vmPort int, typ consts.NatForwardType) (hostPort int, alreadyMapped bool, err error)

func GetUsedPortByKeyword

func GetUsedPortByKeyword(keyword string, defaultVal int) (port int, err error)

find port by keyword

func GetUsedPortByPs

func GetUsedPortByPs(keyword string, defaultVal int) (port int, err error)

find port by ps command

func GetValidPort

func GetValidPort() (hostPort int, err error)

func GetWindowsUsedPortByKeyword

func GetWindowsUsedPortByKeyword(keyword string, defaultVal int) (port int, err error)

func NginxUsedPort

func NginxUsedPort(hostPort int) bool

func NginxUsedPortByTyp

func NginxUsedPortByTyp(hostPort int, typ consts.NatForwardType) bool

func RemoveForward

func RemoveForward(vmIp string, vmPort int, typ consts.NatForwardType) (err error)

func RemoveForwardByPort

func RemoveForwardByPort(vmPort int, typ consts.NatForwardType) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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