A conforming Objective-C WebSocket client library.

SocketRocket After trying to install socketrocket so that I can make PonyDebugger work, I'm getting 3 Apple Match-O linker errors

I'm getting the fllowing. It's my first time trying to install this and I have to since I need the Pony Debugger working.

Undefined symbols for architecture i386:
  "_utf8_countTrailBytes", referenced from:
      _validate_dispatch_data_partial_string in libSocketRocket.a(SRWebSocket.o)
  "_utf8_nextCharSafeBody", referenced from:
      _validate_dispatch_data_partial_string in libSocketRocket.a(SRWebSocket.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any advice is very much appreciated!


EDIT: I added the SocketRocket.Framework to the build Phases and the errors are gone but is now giving me a new one.


The new one doesn't make sense at all.

Source: (StackOverflow)

Library not found Error when simple building web socket chat in iOS?

i downloaded simple web socket chat code and am getting this error

  ld: library not found for -lPods-SocketRocket
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please anyone tell me how to solve this?

In my other linker flags contains these things


My code

Source: (StackOverflow)

Implementin SRWebSocketDelegate in Swift

I am implementing:

@protocol SRWebSocketDelegate <NSObject>

- (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message;


- (void)webSocketDidOpen:(SRWebSocket *)webSocket;
- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error;
- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;

in Swift. All functions I can implement ok and works, but didCloseWithCode I just can't make it to work.

I am having trouble implementing

- (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean;

in Swift.

I am trying:

func webSocket(webSocket: SRWebSocket!, didCloseWithCode code: NSInteger!, reason: NSString!, wasClean: Bool!) {
    println("websocket closed: \(reason)")

with no luck.

Source: (StackOverflow)

Why does my websocket server always report [websocket: control frame length > 125]?

My iOS application uses SocketRocket to establish a connection with my websocket server. But after establishing a connection and sending the first message, the server (using gorilla/websocket) tries to parse the frame, but failed:

message_type, r, err := ws.NextReader()
if err != nil {
    goto end

An error is reported when calling NextReader():

Websocket Read Failed: [websocket: control frame length > 125]

The strange thing is, I use SocketRocket's send() method to send data, so there should never be any control frames (ping/pong).

Has anyone seen this problem before? Help!

Source: (StackOverflow)

How to use SocketRocket with

The new iOS websocket library, SocketRocket, looks really awesome, and the chat example project is really sweet. The example chat server is written in Python, of which I know none. I'm slightly familiar with on node.js and prefer to try javascript. I tried connecting the SocketRocket TestChat simulator app to the node.js(6.10) but the connection was refused. (Also, I'm not a node expert either, so this may be a silly question).

In a recent answer to an SO question, mikelikespie said to op: "I suggest updating your stack to use the iOS WebSocket library we just released."

What does that mean exactly? What is necessary to get the SocketRocket library to talk to a node server? Any sample code or suggestions are greatly appreciated.

Source: (StackOverflow)

Error in opening .xcworkspace

I integrated pods in my project specifically SignalR, AFNetworking and SocketRocket. It was successfully installed, but when I opened .xcworkspace, this error shows:

enter image description here

This is what the project navigator looks like

Has anyone encountered this kind of error? Thanks in advance.

Update: My .xcodeproj has appeared. But the frameworks appear red. How can I solve this?

enter image description here

Source: (StackOverflow)

Class is implemented in both. One of the two will be used

I have a project that has a dependency (installed via CocoaPods) using SocketRocket and have imported a static library from HeapAnalytics. Apparently the HeapAnalytics library already uses SocketRocket. I get no errors when compiling, but at runtime receive the following:

Class SRWebSocket is implemented in both [path] and [path].
One of the two will be used. Which one is undefined.

I'm not sure how to handle it because most solutions I've seen require compiling the static library yourself change class names and such, and I don't have access to the source.

Any recommendations?

Source: (StackOverflow)

iOS Client connecting to server using socketrocket results in "Stream end encountered"

NSString *urlString = @"ip address";
self.webSocket = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
self.webSocket.delegate = self;
[self.webSocket open];

Here didCloseWithCode is called with reason Stream end encountered.

Any ideas about what might go wrong?

Source: (StackOverflow)

SocketRocket (iOS) : How to identify whom user are chatting with another?

I would like to create multiple sockets between all users. So how can i pass key and ID such as the server is divided in seprated windows.

Thank You.

Source: (StackOverflow)

iOS - Best solution for implementing websocket connection across the entire iOS app?

In my app, websocket connection and communication is in the certain ViewController but later came request to receive messages through websocket across the entire app.

What would be the best way to do it? To move the websocket code to AppDelegate or to create super ViewController? Or something else and better?

Source: (StackOverflow)

Is there a fork of SocketRocket that is more stable or actively developed?

I've been using SocketRocket for a few projects and have noticed that SocketRocket has quite a few unresolved issues and is buggy. I have personally patched a few crashes that I have experienced.

Square does not appear to have been maintaining SocketRocket over the past year. Is there another fork of their repo that is considered to be more stable/authoritative?

I would even be willing to consider an alternate library, maybe even one that's written in C/C++ if it can play nice with ObjC coding patterns.

Source: (StackOverflow)

Domain=NSPOSIXErrorDomain Code=61

I'm trying to connect between the client(iOS app) and the server(Node.js) with using SocketRocket and ws like this below.


NSURL *url = [NSURL urlWithString:@"ws://localhost:8080"];
SRWebSocket *_socket = [SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:url];
_socket.delegate = self;
[_socket open];

/* SRWebSocketDelegate */
    [webSocket send:@"something"];
-(void)webSocket:(SRWebSocket*)webSocket didReceiveMessage:(id)message{
    NSLog(@"didReceiveMessage: %@",[message description]);
-(void)webSocket:(SRWebSocket*)webSocket didFailWithError:(NSError*)error{
    NSLog(@"the Error: %@",error);


var WebSocketServer = require('ws').Server
var wss = new WebSocketServer({
        console.log('received: %s', message);

Then, I got the message this below:

the error: Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn’t be completed. Connection refused"

I've searched to solve this, but I couldn't find the exactly solution for this. How do I solve this??

Source: (StackOverflow)

WebSocket Connection is not closing using SocketRocket

I use the SocketRocket library for Objective-C to connect to a websocket:

-(void)open {

if( self.webSocket ) {
    [self.webSocket close];
    self.webSocket.delegate = nil;

self.webSocket = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"ws://"] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20]];
self.webSocket.delegate = self;
[self.webSocket open];

Opening the connection works totally fine. The delegate is called after the connection was established.

-(void)webSocketDidOpen:(SRWebSocket *)webSocket {

NSLog(@"WebSocket is open");


But when I want to close the connection, nothing happens.

-(void)close {

if( !self.webSocket )

[self.webSocket close];
self.webSocket.delegate = nil;


The delegate for successfully closing the connection is not called. Can anyone tell me why this happens?

Thank you for reading my question.

Source: (StackOverflow)

SocketRocket not working on iOS 5.0

I just made a simple real-time text chat application using SocketRocket. It works great on iOS 6.0 and 5.1 but when I try to run it on 5.0 when connecting I get the following error...

Websocket Failed With Error Error Domain=NSOSStatusErrorDomain Code=-9800 "The
operation couldn’t be completed. (OSStatus error -9800.)"
UserInfo=0x6e506e0 {}

Does anyone have any idea what this could mean or how to fix it? I browsed the issues on github but couldnt find anything and its claimed to work on iOS5+.

EDIT: To add, this is when I test on simulator. I dont have a device that has 5.0, so im not sure if fails on the phone in the same way. Also, if I use ws as opposed to wss (encrypted), it seems to work fine.

Source: (StackOverflow)

clients for signalR in native ios and android

1) If I have to develop native IOS client for a server that uses SignalR can I use

SocketRocket or UnittWebSocketClient ?

2) The client App does not use any browser will that matter ?

3) How is SignalR Different from Superwebsocket or microsoft's websocket available in .net 4.5? Dont all of them support rfc6455 protocol ?

Source: (StackOverflow)