Get your localhost online and https - Ngrok Alternative


Keywords
jprq, live, localhost, online, https, ngrok, alternative
License
MIT
Install
pip install jprq==2.1.0

Documentation

jprq.io

github.com/azimjohn/jprq.io/jprq

Overview

Index

Package files

http.go jprq.go messages.go tunnel.go utils.go websocket.go

type Jprq

type Jprq struct {
    // contains unexported fields
}

func New

func New(baseHost string) Jprq

func (*Jprq) AddTunnel

func (j *Jprq) AddTunnel(username string, port int, conn *websocket.Conn) Tunnel

func (*Jprq) DeleteTunnel

func (j *Jprq) DeleteTunnel(host string)

func (Jprq) GetTunnelByHost

func (j Jprq) GetTunnelByHost(host string) (Tunnel, error)

func (Jprq) HttpHandler

func (j Jprq) HttpHandler(writer http.ResponseWriter, request *http.Request)

func (Jprq) WebsocketHandler

func (j Jprq) WebsocketHandler(w http.ResponseWriter, r *http.Request)

type RequestMessage

type RequestMessage struct {
    ID           uuid.UUID            `json:"id"`
    Method       string               `json:"method"`
    URL          string               `json:"url"`
    Body         string               `json:"body"`
    Header       map[string]string    `json:"header"`
    ResponseChan chan ResponseMessage `json:"-"`
}

func FromHttpRequest

func FromHttpRequest(httpRequest *http.Request) RequestMessage

type ResponseMessage

type ResponseMessage struct {
    RequestId uuid.UUID         `json:"request_id"`
    Token     string            `json:"token"`
    Body      string            `json:"body"`
    Status    int               `json:"status"`
    Header    map[string]string `json:"header"`
}

func (ResponseMessage) WriteToHttpResponse

func (responseMessage ResponseMessage) WriteToHttpResponse(writer http.ResponseWriter)

type Tunnel

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

func (Tunnel) DispatchRequests

func (tunnel Tunnel) DispatchRequests()

func (Tunnel) DispatchResponses

func (tunnel Tunnel) DispatchResponses()

type TunnelMessage

type TunnelMessage struct {
    Host  string `json:"host"`
    Token string `json:"token"`
}

Generated by godoc2md