remoton

package module
v0.0.0-...-eb71c1c Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

README

Logo Remoton

DEV STAGE

(Go) Own secure remote desktop multi-platform, own platform for sharing your desktop with software libre

  • do support
  • get desktop access to remote user
  • upload/download files
  • chat

Remoton desktop it's proof concept of Remoton Library

Commands

  • remoton-server-cert generate certificates for secure connections
  • remoton-server handle connections between clients and supports
  • remoton-client-desktop GUI version for sharing desktop
  • remoton-support-desktop GUI version for handling remote desktop

Help

Email me bit4bit@riseup.net

Contributing

What ever you like

Release

See Releases

Install from release

Please check at Releases

Install from source

Install Go 1.4+ and

remoton-server

go get -u github.com/bit4bit/remoton/cmd/remoton-server
go install github.com/bit4bit/remoton/cmd/remoton-server

remoton-server-cert

go get -u github.com/bit4bit/remoton/cmd/remoton-server-cert
go install github.com/bit4bit/remoton/cmd/remoton-server-cert

remoton-client-desktop

go get -u github.com/bit4bit/remoton/cmd/remoton-client-desktop
go install github.com/bit4bit/remoton/cmd/remoton-client-desktop

remoton-support-desktop

go get -u github.com/bit4bit/remoton/cmd/remoton-support-desktop
go install github.com/bit4bit/remoton/cmd/remoton-support-desktop

Usage

Before start, generate the self-signed certificate and key for server and clients. Just run:

~$ remoton-server-cert -host="myipserver.org"

copy cert.pem and key.pem to restricted folder, cert.pem will be shared with terminals -client/support-.

Start a server example: 192.168.57.11

~$ remoton-server -listen="192.168.57.11:9934" -cert "path/cert.pem" -key="path/key.pem"-auth-token="public"

Transfer cert.pem their users.

Now you can connect -terminal- a client (share desktop) or support (connect to shared desktop) we can use the GUI version, just run remoton-client-desktop or remoton-support-desktop

The will need the cert.pem for connect to server.

TODO

  • upnp/pmp only works on GNU/Linux, windows xpra --auth=file not work

POWERED BY

Library

Remoton it's a library for building programmatically tunnels. See Doc

  • Now only support Websocket -Binary- and TCP.

Listener

You can listen inbound connections on remoton server

	import "github.com/bit4bit/remoton"
	....
	
	
	rclient := remoton.Client{Prefix: "/remoton", TLSConfig: &tls.Config{
		InsecureSkipVerify: true,
	}}
	session, err := rclient.NewSession("https://miserver.com:9934", "public")
	if err != nil {
		log.Fatal(err)
	}
	defer session.Destroy()
	
	//now can create a listener for every service you want
	//example
	listener := session.Listen("chat")
	go func(){
		 for {
			conn, err := listener.Accept()
			//now you use conn -net.Conn-
		 }
	}()
	
	listener = session.Listen("rpc")
	//or use it example RPC
	srvRpc := rpc.NewServer()
	srvRpc.Register(&Api)
	go srvRpc.Accept(listener)

Dial

You can dial a active session.

    import "github.com/bit4bit/remoton"

	rclient := remoton.Client{Prefix: "/remoton", TLSConfig: &tls.Config{
		InsecureSkipVerify: true,
	}}
	session := &remoton.SessionClient{Client: rclient,
		ID: "misessionid", AuthToken: "mitoken",
		APIURL: "https://miserver.com:9934"}
	
	//now you can dial any service
	conn, err := session.Dial("chat")
	//use conn -net.Conn-

Documentation

Overview

Package remoton tunnel handlers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressConnection

func CompressConnection(conn net.Conn) net.Conn

func GenerateAuthUser

func GenerateAuthUser() string

func NetCopy

func NetCopy(dst net.Conn, src net.Conn, deadline time.Duration) (written int64, err error)

NetCopy code from io.Copy but with deadline

func NewSessionManager

func NewSessionManager() *sessionManager

func RegisterTunnelType

func RegisterTunnelType(typ string, f func(net.Conn) http.Handler)

RegisterTunnelType for handling type of connections

Types

type Client

type Client struct {
	Prefix    string
	TLSConfig *tls.Config
	Origin    string
}

Client allow creation of sessions

func (*Client) NewSession

func (c *Client) NewSession(_url string, authToken string) (*SessionClient, error)

NewSession create a session on server

type ErrHTTP

type ErrHTTP struct {
	Code int
	Msg  string
}

func (ErrHTTP) Error

func (c ErrHTTP) Error() string

type Server

type Server struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

Server export API for handle connections this follow http.Handler can be embedded in any web app

func NewServer

func NewServer(authFunc func(authToken string, r *http.Request) bool, idGenerator func() string) *Server

NewServer create a new http.Listener, *authFunc* for custom authentication and idGenerator for identify connections

type SessionClient

type SessionClient struct {
	*Client

	ID        string
	AuthToken string

	//WSURL web socket url by default it try
	//to guess from baseUrl
	WSURL string

	APIURL string
	// contains filtered or unexported fields
}

SessionClient it's a session where we can create Services a services it's a connection -net.Conn-

func (*SessionClient) Destroy

func (c *SessionClient) Destroy()

Destroy the current session this not close active connections

func (*SessionClient) Dial

func (c *SessionClient) Dial(service string) (net.Conn, error)

Dial create a new *service* -net.Conn- Websocket

func (*SessionClient) DialTCP

func (c *SessionClient) DialTCP(service string) (net.Conn, error)

Dial create a new *service* -net.Conn- TCP

func (*SessionClient) Listen

func (c *SessionClient) Listen(service string) net.Listener

Listen implementes net.Listener for Websocket connections

func (*SessionClient) ListenTCP

func (c *SessionClient) ListenTCP(service string) net.Listener

Listen implementes net.Listener for TCP connections

type SessionListen

type SessionListen struct {
	*SessionClient
	// contains filtered or unexported fields
}

SessionListen tunnel type websocket by default

func (*SessionListen) Accept

func (c *SessionListen) Accept() (net.Conn, error)

Accept implements the net.Accept for Websocket

func (*SessionListen) AcceptTCP

func (c *SessionListen) AcceptTCP() (net.Conn, error)

Accept implements the net.Accept for TCP

func (*SessionListen) Addr

func (c *SessionListen) Addr() net.Addr

func (*SessionListen) Close

func (c *SessionListen) Close() error

type SessionListenTCP

type SessionListenTCP struct {
	*SessionClient
	// contains filtered or unexported fields
}

SessionListenTCP tunnel type TCP

func (*SessionListenTCP) Accept

func (c *SessionListenTCP) Accept() (net.Conn, error)

func (*SessionListenTCP) Addr

func (c *SessionListenTCP) Addr() net.Addr

func (*SessionListenTCP) Close

func (c *SessionListenTCP) Close() error

Directories

Path Synopsis
cmd
remoton-client-desktop
+build linux,windows
+build linux,windows
remoton-support-desktop
Package remoton-client-desktop Shared desktop to support user.
Package remoton-client-desktop Shared desktop to support user.
p2p/nat
Package nat provides access to common network port mapping protocols.
Package nat provides access to common network port mapping protocols.

Jump to

Keyboard shortcuts

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