Skip to content

Instantly share code, notes, and snippets.

View hightemp's full-sized avatar
🎯
Focusing

Anton Panov hightemp

🎯
Focusing
View GitHub Profile
package main
import (
"bufio"
"fmt"
"io"
"log"
"net"
"strings"
)
@hightemp
hightemp / https_socket_proxy.go
Last active August 6, 2024 07:58
simple https proxy on golang
package main
import (
"bufio"
"crypto/tls"
"fmt"
"io"
"log"
"net"
"strings"
@hightemp
hightemp / awesome-php.md
Created June 27, 2024 06:38 — forked from llbbl/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks
@hightemp
hightemp / wget-mirror-website.sh
Created February 23, 2024 10:55 — forked from svagionitis/wget-mirror-website.sh
A script to mirror a website using wget
#!/bin/sh -eu
# A script to mirror a website using wget
usage() {
cat << EOF
Usage: $(basename "$0") [-w website] [-u user_agent] [-b]
Where:
-w The website to mirror. The website will be like "https://example.com/"
-u The User agent to use. If no User agent is specified,
a Firefox default one is used.
@hightemp
hightemp / readme.md
Created February 9, 2024 08:55 — forked from sergey-glushakov/readme.md
Nvim плагины позволяющие форматировать код PHP

Nvim плагины позволяющие форматировать код PHP

В Nvim существует несколько плагинов, которые могут помочь вам форматировать код PHP. Вот некоторые из них:

  1. php-cs-fixer: Этот плагин был описан в предыдущем ответе и позволяет автоматически форматировать код согласно стандартам PHP.

    Для настройки php-cs-fixer в nvim, добавьте следующую строку в файл конфигурации:

    lua
    

require('php-cs-fixer').setup()

@hightemp
hightemp / article.md
Last active January 27, 2024 07:05
HTTP(S) Proxy in Golang in less than 100 lines of code

The goal is to implement a proxy server for HTTP and HTTPS. Handling of HTTP is a matter of parsing request, passing such request to destination server, reading response and passing it back to the client. All we need for that is built-in HTTP server and client (net/http). HTTPS is different as it’ll use technique called HTTP CONNECT tunneling. First client sends request using HTTP CONNECT method to set up the tunnel between the client and destination server. When such tunnel consisting of two TCP connections is ready, client starts regular TLS handshake with destination server to establish secure connection and later send requests and receive responses. Certificates

Our proxy will be an HTTPS server (when —-proto https will be used) so we need certificate and private key. For the purpose of this post let’s use self-signed certificate. To generate one use such script:

#!/usr/bin/env bashcase `uname -s` in
 
@hightemp
hightemp / GolangSSHTunnelForwardAndReverse.go
Created January 13, 2024 11:50 — forked from 0187773933/GolangSSHTunnelForwardAndReverse.go
Golang SSH Forward and Reverse Tunnel
package main
import (
"context"
"fmt"
"os"
"os/signal"
"path"
"sync"
"syscall"
@hightemp
hightemp / HttpProxy.go
Created January 13, 2024 11:50 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)