Coder Social home page Coder Social logo

runtogether's Introduction

runtogether

http请求的多端口转发以达到提速的目的

Install

pip install runtogether

Run in Project

from runtogether.handles import Referee server = Referee(app=app, host='0.0.0.0', port=8899, workers=4) server.run()

Run in Teminal

For Flask

创建wsgi文件,并引入create_app方法,创建一个app对象.如:

from your_project.app import create_app wsgi = create_app()

For Django

django自带wsgi文件,且内含可用的application对象.

在命令行输入

rtg -ro <your_project path> -mo : -ho -po -w0

Flask如:

rtg -ro /MyProject/ -mo wsgi:application -ho 0.0.0.0 -po 8888 -wo 4

django时, 命令行需要注意-ro和-mo部分. -ro部分比Flask时候少引入一层, 在-mo内以点(.)连接.如:

rtg -ro MyProject -mo MainPackage.wsgi:application -ho 0.0.0.0 -po 8888 -wo 4

runtogether's People

Contributors

csy5621080 avatar

Watchers

James Cloos avatar

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.