pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/orijtech/frontender

GitHub - orijtech/frontender: Setup a server frontend with HTTPS that then proxies to traffic to a backend/cluster · GitHub
Skip to content

orijtech/frontender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frontender

Setup a server frontend with HTTPS that then proxies to traffic to a backend/cluster.

This project is used inside orijtech to create for folks HTTPS servers that can then be put in Docker images, or automatically uploaded to respective cloud storage systems and passed into some container engine for a disk image.

Examples:

  • Preamble with imports:
package frontender_test

import (
	"io"
	"log"
	"os"

	"github.com/orijtech/frontender"
)
  • Plain listen as a server:
func listen() {
	lc, err := frontender.Listen(&frontender.Request{
		Domains: []string{
			"git.orijtech.com",
			"repo.orijtech.com",
		},
		NonHTTPSRedirectURL: "https://git.orijtech.com",

		ProxyAddress: "http://localhost:9845",

		NoAutoWWW: true,
	})
	if err != nil {
		log.Fatal(err)
	}
	defer lc.Close()

	if err := lc.Wait(); err != nil {
		log.Fatal(err)
	}
}
  • Generate the binary of the server for a platform
func generateBinary() {
	rc, err := frontender.GenerateBinary(&frontender.DeployInfo{
		FrontendConfig: &frontender.Request{
			Domains: []string{
				"www.medisa.orijtech.com",
				"medisa.orijtech.com",
				"m.orijtech.com",
			},
			ProxyAddress: "http://192.168.1.105:9855",
		},
		TargetGOOS: "linux",
		Environ:    []string{"CGO_ENABLED=0"},
	})
	if err != nil {
		log.Fatal(err)
	}
	defer rc.Close()

	f, err := os.Create("theBinary")
	if err != nil {
		log.Fatal(err)
	}
	defer f.Close()

	io.Copy(f, rc)
}
  • Generate a Docker image for the server
func generateDockerImage() {
	imageName, err := frontender.GenerateDockerImage(&frontender.DeployInfo{
		CanonicalImageNamePrefix: "frontender",
		FrontendConfig: &frontender.Request{
			Domains: []string{
				"git.orijtech.com",
				"repo.orijtech.com",
			},
			NonHTTPSRedirectURL: "https://git.orijtech.com",

			ProxyAddress: "http://localhost:9845",

			NoAutoWWW: true,
		},
		ImageName: "odex-auto",
	})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("ImageName: %q\n", imageName)
}

About

Setup a server frontend with HTTPS that then proxies to traffic to a backend/cluster

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy