This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proxy-providers: | |
| provider1: | |
| url: "xxx" | |
| type: http | |
| interval: 86400 | |
| # health-check: {enable: true,url: "https://www.gstatic.com/generate_204",interval: 300} | |
| override: | |
| additional-prefix: "[p1]" | |
| provider2: | |
| url: "xxx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from svc import log # noqa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/env python3 | |
| import signal | |
| import socket | |
| import multiprocessing | |
| import asyncio | |
| import logging | |
| import argparse | |
| from threading import Event | |
| from asyncio import StreamReader, StreamWriter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """A quick benchmark comparing the performance of: | |
| - msgspec: https://github.com/jcrist/msgspec | |
| - pydantic V1: https://docs.pydantic.dev/1.10/ | |
| - pydantic V2: https://docs.pydantic.dev/dev-v2/ | |
| The benchmark is modified from the one in the msgspec repo here: | |
| https://github.com/jcrist/msgspec/blob/main/benchmarks/bench_validation.py | |
| I make no claims that it's illustrative of all use cases. I wrote this up |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This gist shows how to run asyncio loop in a separate thread. | |
| It could be useful if you want to mix sync and async code together. | |
| Python 3.7+ | |
| """ | |
| import asyncio | |
| from datetime import datetime | |
| from threading import Thread | |
| from typing import Tuple, List, Iterable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const findIP = (onNewIP) => { // onNewIp - your listener function for new IPs | |
| // compatibility for firefox and chrome | |
| const myPeerConnection = window.RTCPeerConnection || | |
| window.mozRTCPeerConnection || | |
| window.webkitRTCPeerConnection | |
| const pc = new myPeerConnection({ iceServers: [] }) | |
| const noop = () => {} | |
| const localIPs = {} | |
| const ipRegex = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
| # A list of available STUN server. | |
| stun.l.google.com:19302 | |
| stun1.l.google.com:19302 | |
| stun2.l.google.com:19302 | |
| stun3.l.google.com:19302 | |
| stun4.l.google.com:19302 | |
| stun01.sipphone.com | |
| stun.ekiga.net |