GithubHelp home page GithubHelp logo

cometps's Introduction

cometpsd

Simple comet pub/sub server with an optional shared secret for controlling publish rights.

Open source licensed under MIT, by Rasmus Andersson.

Example

Start a server in a terminal:

$ cometpsd -k xyz

Open http://localhost:8080/channel/default in your web browser.

In another terminal, use curl to publish something:

$ curl -i -X POST -H 'X-CPS-Publish-Key: xyz' \
  --data-binary '<p>hello</p>' localhost:8080/channel/default

"hello" should appear in your browser when you run the command above. Open more tabs with http://localhost:8080/channel/default and run the curl command a few more times.

Configuration file

The server can be configured by a YAML file (passing filename, or "-" for stdin, with -f flag) which can describe multiple servers, which in turn each can describe multiple channels.

Parameters like address, port and log_level are hierarchical -- i.e. specifying log_level 3 for a server will implicitly set log_level 3 for all its channels which do not themselves set log_level.

Example

servers:
  - address: "0.0.0.0" # ANY
    port: 8080
    channels:
      test:
        publish_key: xyz
        log_level: 3
      test2:
        max_clients: 3

  - port: 8081
    log_level: 2
    channels: {a: {publish_key: xyz}, b: {}}

cometps's People

Contributors

rsms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cometps's Issues

Error when running (Ubuntu 10.10 64bit)

With:
cometps$ cometpsd -k xyz
cometpsd: Command not found

Then i tried first to use make:
cometps$ make
cc -Wall -I/opt/local/include -I. -c cometpsd.c -o cometpsd.o
In file included from cometpsd.c:43:
yconf.h:4: fatal error: yaml.h: File not found

The last thing i tried was to create the missing yaml.h file:
servers:
address: "0.0.0.0" # ANY
port: 8080
channels:
test:
publish_key: xyz
log_level: 3
test2:
max_clients: 3

port: 8081
log_level: 2
channels: {a: {publish_key: xyz}, b: {}}

This result was a bunch of errors. Please advice what to do.

Thanks!

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.