reverse-proxy

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

reverse-proxy

A very simple reverse proxy in go

Generate self-signed certficates
openssl req  -new  -newkey rsa:2048  -nodes  -keyout revpro.key  -out revpro.csr

openssl  x509  -req  -days 365  -in revpro.csr  -signkey revpro.key  -out revpro.crt
Use the revpro.key and revpro.crt in the cli:
reverse-proxy start --ipaddress 172.200.18.22 --port 443 --protocol https --proxyport 8080 --httptimeout 10 --certfile cert.crt --keyfile key.key
reverse-proxy start --ipaddress 172.200.18.22

Usage:
  reverse-proxy start [flags]

Flags:
      --certfile string    certificate file with path for tls (default "./certs/revpro.crt")
  -h, --help               help for start
      --httptimeout int    http timeout value in seconds (default 10)
      --ipaddress string   ip of the remote server
      --keyfile string     certificate key file with path for tls (default "./certs/revpro.key")
      --port string        port of the remote server (default "443")
      --protocol string    protocol to connect http/https (default "https")
      --proxyport string   proxyport on which the revereproxy would be served (default "8080")

The port might be blocked by your IT. Make sure to check what ports are available.
For the example IP in the reverseproxy.go, this is how a typical curl command to your server would look like
curl -XGET -u username:password https://100.67.28.113:8080/yourendpoint  --insecure

Documentation

Overview

Copyright © 2021 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
internal
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳