Giter Site home page Giter Site logo

linecode / fooking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scgywx/fooking

0.0 1.0 0.0 2.45 MB

distributed gateway server(php game server, tcp server, websocket server)

Makefile 0.39% Lua 6.18% PHP 6.36% Go 3.43% HTML 10.31% ActionScript 2.01% Python 2.18% C 0.53% C++ 68.60%

fooking's Introduction

fooking is distributed gateway server.It transfers client's requests to backend and send responses back with fpm protocol.
Just like Nginx, as building a http server with nginx and fastcgi server(e.g fpm, etc..), you can create a socket server with fooking.

features

1 gateway server adding dynamicly.
2 unique sessionid for each client.
3 group broadcast(like redis's pub/sub).
4 server status monitor.
5 clients event notify(onconnect and onclose).
6 all language supported(php, python, etc...).
7 custom message protocol by lua.
8 backend connection keepalive.

client protocol

client protocol is the protocol use in clients to fooking,
default build up with 4 bytes header in bigend and body, But you can custom protocol with lua(reference script.lua).

backend protocol

backend protocol is the protocol use in fooking to backends, you can use any luanguage with support fastcgi.
this protocol is simply, reference: http://www.fastcgi.com/drupal/node/6?q=node/22

getting started

this example is chat room, source code in example/chat

  • Step 1(download and compile)
    git clone https://github.com/scgywx/fooking.git
    cd {$FOOKING_PATH}
    make
  • Step 2(start fooking router server)
    cd src
    ./fooking ../router.lua
  • Step 3(start fooking gateway server)
    ./fooking ../config.lua
  • Step 4(start fastcgi server, e.g php-fpm) service php-fpm start(if it was started please skip this step)
  • Step 5(test) modify websocket server host and port in example/chat/index.html(search 'ws://')
    open index.html in your browser and starting chat

arch

image

fooking's People

Contributors

hellovigoss avatar scgywx avatar

Watchers

 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.