grdp

package module
v0.2.1 Latest Latest
Warning

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

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

README

Golang Retome Desktop Protocol

grdp is a pure Golang implementation of the Microsoft RDP (Remote Desktop Protocol) protocol (client side authorization only).

Status

The project is under development and not finished yet.

  • SSL Authentication (soon)
  • NLA Authentication

Example

client := grdp.NewClient(Host)
err := client.Login(User, Password)
if err != nil {
    fmt.Printf("connect failed: %#v\n", err)
    os.Exit(2)
    return
}
defer client.Close()

fmt.Printf("connected!\n")

sig := make(chan struct{})
once := new(sync.Once)
done := func() {
    once.Do(func() {
        close(sig)
    })
}

client.OnError(func(e error) {
    fmt.Printf("%s Error = %#v\n", time.Now(), e)
    done()
})
client.OnSuccess(func() {
    fmt.Printf("%s Success\n", time.Now())
})
client.OnReady(func() {
    fmt.Printf("%s Ready\n", time.Now())
})
client.OnClose(func() {
    fmt.Printf("%s Close\n", time.Now())
    done()
})
client.OnUpdate(func(_ []pdu.BitmapData) {
    fmt.Printf("%s Update\n", time.Now())
})

fmt.Printf("waiting...\n")
<-sig

Take ideas from

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host string // ip:port
	// contains filtered or unexported fields
}

func NewClient

func NewClient(host string) *Client

func NewClientConn added in v0.2.1

func NewClientConn(conn net.Conn) *Client

func (*Client) Close added in v0.2.0

func (g *Client) Close()

func (*Client) Login

func (g *Client) Login(user, pwd string) error

func (*Client) OnClose added in v0.2.0

func (g *Client) OnClose(f func())

func (*Client) OnError added in v0.2.0

func (g *Client) OnError(f func(e error))

func (*Client) OnReady added in v0.2.0

func (g *Client) OnReady(f func())

func (*Client) OnSuccess added in v0.2.0

func (g *Client) OnSuccess(f func())

func (*Client) OnUpdate added in v0.2.0

func (g *Client) OnUpdate(f func([]pdu.BitmapData))

Directories

Path Synopsis
protocol
lic
nla
pdu
sec

Jump to

Keyboard shortcuts

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