GithubHelp home page GithubHelp logo

rockemsockem's Introduction

RockemSockem

RockemSockem isn't just an awesome name. It's a super-simple, ReactiveCocoa-based WebSocket server for OS X.

It uses CocoaHTTPServer to do all the hard stuff. Because the hard stuff is hard. Basically all the credit goes to them.

How do I use it?

  1. Add RockemSocket.xcodeproj to your project or workspace.
  2. Add RockemSockem to your Target Dependencies.
  3. Add RockemSockem.framework to your Link Binary with Libraries.
  4. Add RockemSockem.framework to a Copy Files phase which copies it into Frameworks.
  5. Weep that this list of instructions is so damn long.
  6. Follow all those same steps, but for ReactiveCocoa (in External).
server = [[RSMServer alloc] init];
server.port = 12345;
server.interface = @"localhost";
[server.webSockets subscribeNext:^(RSMWebSocket *socket) {
	[socket sendMessage:@"Sock it to me."];
	[socket.messages subscribeNext:^(NSString *message) {
		NSLog(@"Got \"%@\" from %@", message, socket);
	}];
}];

NSError *error;
BOOL success = [server start:&error];
if (!success) {
	NSLog(@"Error starting server: %@", error);
}

See RockemSockemSample for a slightly complete example.

If you’re developing RockemSockem on its own, then simply open RockemSockem.xcworkspace.

What about iOS?

If you're running a WebSocker server on iOS I feel bad for you son. I got 99 problems and RockemSockem not running on iOS ain't one. (Pull requests welcome.)

rockemsockem's People

Contributors

joshaber avatar jspahrsummers avatar robrix avatar bigboybad avatar mdiep 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.