Dockerized: V2ray + WebSocket + TLS + Web
also see: https://toutyrater.github.io/advanced/wss_and_web.html
Server side sontents:
- Caddyfile
- config.json
- docker-compose.yml
Client side contents:
| (ns authexample.web | |
| (:gen-class) | |
| (:require [buddy.auth :refer [authenticated? throw-unauthorized]] | |
| [buddy.auth.backends.session :refer [session-backend]] | |
| [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]] | |
| [clojure.java.io :as io] | |
| [compojure.response :refer [render]] | |
| [reitit.ring :as ring] | |
| [ring.adapter.jetty :as jetty] | |
| [ring.middleware.params :refer [wrap-params]] |
Dockerized: V2ray + WebSocket + TLS + Web
also see: https://toutyrater.github.io/advanced/wss_and_web.html
Server side sontents:
Client side contents:
| package com.gypsyengineer.tlsbunny.jsse; | |
| import javax.net.ssl.SSLServerSocket; | |
| import javax.net.ssl.SSLServerSocketFactory; | |
| import javax.net.ssl.SSLSocket; | |
| import javax.net.ssl.SSLSocketFactory; | |
| import java.io.*; | |
| /* | |
| * Don't forget to set the following system properties when you run the class: |
A Pen by Eduardo Gonçalves on CodePen.
| # maximum capability of system | |
| user@ubuntu:~$ cat /proc/sys/fs/file-max | |
| 708444 | |
| # available limit | |
| user@ubuntu:~$ ulimit -n | |
| 1024 | |
| # To increase the available limit to say 200000 | |
| user@ubuntu:~$ sudo vim /etc/sysctl.conf |
| Let's Reinvent Modern CPU Caches! | |
| In The Beginning, programs were hard-coded, entered directly with switches. Values would be input, and then results would output, | |
| but couldn't really be stored. We'll draw this like so: | |
| Input -> Fixed Calculations -> Output | |
| An early improvement in generality was the addition of storage (ENIAC eventually gained 100 words of magnetic core memory), | |
| leaving us with something along these lines: |
Vodafone forces its customers to use their modem/router, the "Vodafone Station": using any other router is impossible because authentication is being done via a custom PPPoE setup.
In the PPPoE packet there is a field named Host-Uniq which is used to separate packets from different PPPoE sessions: Vodafone requires the Station serial number to be put in this field as authentication.
A Linux router with root access is needed to replace the Station with. With an xDSL connection a modem with a custom firmware like OpenWrt has to be used, most likely one based on a Lantiq SoC.
For a FTTH internet connection then every machine with at least two gigabit ethernet interface and a decent CPU will do it.
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| # This config came around after a friend had problems with a Steam cache on his | |
| # Cox internet connection. Cox would intercept any requests to Steam content | |
| # servers and return a 302 to Cox's servers. The cache would return the 302 | |
| # to the Steam client, and the Steam client would go directly to Cox, bypassing | |
| # the cache. | |
| # This config makes nginx follow the 302 itself, and caches the result of the | |
| # redirect as if it was the response to the original request. So subsequent | |
| # requests to the URL that returned a 302 will get the file instead of a 302. |
| import java.util.concurrent.atomic.AtomicInteger | |
| import java.util.concurrent.{Executors, TimeUnit} | |
| import akka.actor.{ActorSystem, Props} | |
| import akka.routing.ConsistentHash | |
| import akka.stream.actor._ | |
| import akka.stream.scaladsl.{Flow, GraphDSL, RunnableGraph, Sink, Source} | |
| import akka.stream.{ActorMaterializer, ClosedShape, ThrottleMode} | |
| import com.kifi.franz.{MessageId, SQSMessage} |