p2pquic

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

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 18 Imported by: 0

README

p2pquic

QUIC/ICE demo using quic-go and pion/ice. Based on the quic-go echo example and the pion/ice example.

Build and Run

Start two terminals. In the first, run:

go run cmd/main.go -server -ice

In the second one run:

go run cmd/main.go -ice -local 9001 -remote 9000

When both processes are running, press enter in both terminals. You should see some log messages about ICE connection states and candidates. When the connection is established, the QUIC client sends the message foobar, which is then echoed back by the server.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(message string) (*Client, error)

func (*Client) RunICE

func (c *Client) RunICE(localPort, remotePort int) error

func (*Client) RunUDP

func (c *Client) RunUDP(addr string) error

type ICEPacketConn

type ICEPacketConn struct {
	*ice.Conn
	// contains filtered or unexported fields
}

func (*ICEPacketConn) ReadFrom

func (c *ICEPacketConn) ReadFrom(p []byte) (int, net.Addr, error)

ReadFrom implements net.PacketConn

func (*ICEPacketConn) WriteTo

func (c *ICEPacketConn) WriteTo(p []byte, addr net.Addr) (int, error)

WriteTo implements net.PacketConn

type ICESignalingServer

type ICESignalingServer struct {
	// contains filtered or unexported fields
}

func NewICESignalingServer

func NewICESignalingServer(remotePort, localPort int) (*ICESignalingServer, error)

type Server

type Server struct {
}

func NewServer

func NewServer() (*Server, error)

func (*Server) RunICE

func (s *Server) RunICE(localPort, remotePort int) error

func (*Server) RunUDP

func (s *Server) RunUDP(addr string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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