Code Monkey home page Code Monkey logo

online-ping-demo's Introduction

online-ping-demo

简易在线ping工具,将ping命令输出实时显示到web页面,基于Flask-SocketIO/socket.io

  • python 版本基于(flask | Flask-SocketIO | gevent)
  • nodejs 版本基于(express | socket.io)

Usage

下载并安装依赖

git clone [email protected]:sincerefly/online-ping-demo.git
cd online-ping-demo

# python
cd python
pip install -r requirements.txt

# nodejs
cd nodejs
npm install

Run

首先将静态页变为可访问

# 如使用python的简易服务器,默认会监听8000端口
python -m SimpleHTTPServer
# python
python app.py

# nodejs
nodejs index.js

Note

  • Flask 程序默认监听的5000端口,python 默认HTTP服务器监听的8000 端口, 请确保这两个端口没有被占用
  • index.html并不要求和app.py放在一处,app.py只是一个接口

打开浏览器访问(如果是本地的话)

http://localhost:8000

ping

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.