• This repository has been archived on 18/Sep/2018
  • Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Python
  • License
    Other
  • Created almost 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

websockets for reddit

reddit-service-websockets

Websockets for reddit.

This service is primarily aimed at broadcasting messages to clients. It can also optionally report to the backend when clients connect or disconnect. All communication with other backend services is mediated by an AMQP broker (RabbitMQ).

Usage

Applications using this service are in charge of managing authorization. The service validates that incoming requests were authorized by the main application using a message authentication code. The path portion of a websocket request indicates which message "namespace" the socket will receive.

Messages are sent to the service via an AMQP fan out exchange. Each worker process binds to the exchange and will receive all messages sent to it. Messages are dispatched to appropriate websocket clients by mapping the message's routing key to the socket namespace specified in the websocket request.

If configured to do so, the service will also insert connect/disconnect messages onto a topic exchange in AMQP.

Testing and Development

There are two Docker images provided for development and testing.

  • Dockerfile: A Docker image definition for running a local version of the service.
  • Dockerfile.test: A Docker image definition for running tests.
# Exposes websocket service at 127.0.0.1:9090
docker build . -t ws-server -f Dockerfile  && docker run --rm -p 9090:9090 ws-server

# Run code tests
docker build . -t ws-tests -f Dockerfile.test  && docker run ws-tests

Further reading

This service is used and written for reddit.com's socket needs. Client and server code examples can be found in the monolith's repos:

More Repositories

1

reddit

historical code from reddit.com
Python
16,788
star
2

reddit1.0

Common Lisp
2,063
star
3

reddit-plugin-place-opensource

place
JavaScript
984
star
4

iReddit

The iReddit iPhone app
Objective-C
481
star
5

reddit-i18n

reddit's translation files - USE CROWDIN TO SUBMIT TRANSLATIONS. Direct pull requests to this repository will, generally, be rejected.
Python
136
star
6

reddit-plugin-thebutton

The Button.
Python
112
star
7

reddit-plugin-robin

robin
JavaScript
94
star
8

push

this tool has been replaced with rollingpin ->
Python
79
star
9

public-data-sets

45
star
10

reddit-plugin-liveupdate

the code behind reddit live
JavaScript
44
star
11

reddit-plugin-gold

reddit gold plugin
JavaScript
27
star
12

reddit-plugin-about

reddit about pages plugin
JavaScript
20
star
13

tallier

high performance statsd drop-in
Go
20
star
14

postcards

stupid-simple thingy for managing postcards
Python
9
star
15

cabot-alert-twilio

reddit custom twilio alerting plugin for cabot
Python
9
star
16

reddit-plugin-meatspace

tools for meetups
Python
9
star
17

reddit-service-activity

activity counting service
Python
9
star
18

reddit-plugin-f2p

april fools 2013
Python
8
star
19

reddit-service-ads-tracking

This service provides endpoints for tracking ad clicks, impressions, and conversions.
Python
8
star
20

art-gallery

Submodule for common styles and assets used in reddit projects
CSS
6
star
21

reddit-plugin-betamode

reddit beta testing mode
Python
5
star
22

reddit-plugin-donate

reddit donate
JavaScript
5
star
23

reddit-plugin-dfp

dave's fantastic plugin
Python
4
star
24

metron-client

JavaScript
3
star
25

Lob

convenience bits over volley
Java
3
star
26

reddit-mobile-plugin-metrics

JavaScript
3
star
27

metron

JavaScript
3
star
28

node-mothership

CLI tools for running platform projects
JavaScript
3
star
29

reddit-cookiecutter-r2plugin

skeleton of a reddit plugin
Python
3
star
30

reddit-mobile-plugin-ads

JavaScript
2
star