Giter Site home page Giter Site logo

juzeon / tun4colab Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 12 KB

A helper program that allows for parallel execution of API services and utilizes Cloudflare Quick Tunnel for port forwarding on Google Colab.

License: MIT License

Go 100.00%
cloudflare cloudflare- cloudflare-argo cloudflare-argo-tunnel cloudflare-tunnel cloudflared colab colab-notebook colaboratory google-colab

tun4colab's Introduction

tun4colab

A helper program that allows for parallel execution of API services and utilizes Cloudflare Quick Tunnel for port forwarding on Google Colab.

Build

Requires Go 1.21+

# If using Windows
set GOOS=linux
set GOARCH=amd64

# Build for colab
go build

Usage

-p <Port 1> -p <Port 2> ... -p <Port N>
-c <Command 1> -c <Command 2> ... -c <Command 3>

e.g.

./tun4colab -p 8080 -p 8081 -c "http-server -p 8080" -c "python api.py -p 8081"

The output of the API services will be redirected to stdout, while the endpoints of the tunnels will be printed once they are created.

Example

> ./tun4colab -p 8081 -c "cd D:\Go && http-server -p 8081"
2023/11/08 22:24:00 INFO Ports to open: ports=[8081]
2023/11/08 22:24:00 INFO Commands to execute: commands="cd D:\\Go && http-server -p 8081"
Starting up http-server, serving ./

http-server version: 14.1.1

http-server settings:
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://2.0.0.1:8081
  http://172.20.160.1:8081
  http://192.168.137.1:8081
  http://192.168.58.1:8081
  http://192.168.168.1:8081
  http://10.27.214.248:8081
  http://127.0.0.1:8081
Hit CTRL-C to stop the server

2023/11/08 22:24:03 INFO Tunnel created port=8081 url=https://mas-production-complicated-tag.trycloudflare.com

tun4colab's People

Contributors

juzeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

5l1v3r1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.