internal

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package internal defines common types and functions used by both tunnel clients and servers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnterRawTerminalMode

func EnterRawTerminalMode(ctx *context.T) string

EnterRawTerminalMode uses stty to enter the terminal into raw mode; stdin is unbuffered, local echo of input characters is disabled, and special signal characters are disabled. Returns a string which may be passed to RestoreTerminalSettings to restore to the original terminal settings.

func Forward

func Forward(conn net.Conn, s sender, r receiver) error

Forward forwards data read from net.Conn to a TunnelForwardClientStream or a TunnelForwardServerStream.

func RestoreTerminalSettings

func RestoreTerminalSettings(ctx *context.T, saved string)

RestoreTerminalSettings uses stty to restore the terminal to the original settings, taking the saved settings returned by EnterRawTerminalMode.

func SetWindowSize

func SetWindowSize(fd uintptr, ws Winsize) error

SetWindowSize sets the terminal's window size.

Types

type Winsize

type Winsize struct {
	Row    uint16
	Col    uint16
	Xpixel uint16
}

Winsize defines the window size used by ioctl TIOCGWINSZ and TIOCSWINSZ.

func GetWindowSize

func GetWindowSize() (*Winsize, error)

GetWindowSize gets the terminal's window size.

Jump to

Keyboard shortcuts

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