Documentation
¶
Index ¶
Constants ¶
View Source
const ( AMOUNT_VOUCHER_PARAM = "amount" CHANNEL_ID_VOUCHER_PARAM = "channelId" SIGNATURE_VOUCHER_PARAM = "signature" VOUCHER_CONTEXT_ARG contextKey = "voucher" ErrPayment = types.ConstError("payment error") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReversePaymentProxy ¶
type ReversePaymentProxy struct {
// contains filtered or unexported fields
}
ReversePaymentProxy is an HTTP proxy that charges for HTTP requests.
func NewReversePaymentProxy ¶
func NewReversePaymentProxy(proxyAddress string, nitroEndpoint string, destinationURL string, costPerByte uint64) *ReversePaymentProxy
NewReversePaymentProxy creates a new ReversePaymentProxy.
func (*ReversePaymentProxy) ServeHTTP ¶
func (p *ReversePaymentProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the main entry point for the reverse payment proxy server. It is responsible for parsing the voucher from the query params and moving it to the request header It then delegates to the reverse proxy to handle rewriting the request and sending it to the destination
func (*ReversePaymentProxy) Start ¶
func (p *ReversePaymentProxy) Start() error
Start starts the proxy server in a goroutine.
func (*ReversePaymentProxy) Stop ¶
func (p *ReversePaymentProxy) Stop() error
Stop stops the proxy server and closes everything.
Click to show internal directories.
Click to hide internal directories.