-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP GET Header #16
Comments
StompKit does not work over WebSocket. You should connect to the STOMP broker on its stomp port (usually 61613), not over a Web Socket on the 80 port. |
Hi. Thanks for the quick reply. We are using STOMP over web sockets (Port 80). I can't seem to find any frameworks to support this? Is there any way of getting STOMPKit to work like this? Can I do a standard web socket connection and pass this connection to StompKit? The Javascript / Frontend guys are connecting to STOMPKit this:
Thanks |
Like I said, StompKit can connect to the STOMP broker on a regular TCP port. Which broker are you using? the stomp.js JavaScript library you are using is connecting over a Web Socket because you have no choice from a Web browser. But from an Objective-C client, there is no such restriction and you can connect to the TCP port directly. |
@jodm StompKit is well written and won't require many changes to get your messages to go over websockets. You will need to replace GCDAsyncSocket with a web socket client. The only complete iOS one I know of is SocketRocket. |
@masgharneya I finally got it working but thank you for your advise. I used SocketRocket to do the websocket connection and then wrote my own STOMP message framework. For anyone interested I am planning on releasing this as a library: https://github.com/jodm/SocketStompRocket It will be uploaded by the end of March I just need to finish the iPhone application I am working on and I will extract it and make it standalone. |
@jodm I want to know whether you have updated SocketStompRocket library on any other repository location? Because https://github.com/jodm/SocketStompRocket location do not have any other file except README.md file. |
Hi @jodm , even I required SocketStompRocket library, can you please share repository location. |
Hi. @Sumitkashid @gandhrekunal You know what it's like, best intensions to extract code from a project into a separate library and never get a chance. I will try and find some time this week and extract it and update the SocketStompRocket repository. Edit: One thing to note is I no longer have access to the Stomp / Socket Server so I won't be able to fully test but the code was working when the server was live. Thanks |
I have an outstanding pull request to integrate this functionality using RocketSockets. It seems to be working except the heartbeating (receiving PONG from my server) isn't working. I'm not sure which end is at fault yet. |
@tbowers your PR will remove StompKit's ability to work over plain sockets. Might make more sense as a separate project. |
@masgharneya could you elaborate how? I specifically implemented the strategy pattern so that the existing raw socket usage would still work. If you init with a host that starts w/ "ws://", it'll use web sockets. If you init with host and port (i.e. existing API), the raw socket will be used. |
@tbowers my mistake. I looked at one of the files you changed and saw that you removed a GCDAsyncSocket import so I assumed you removed it from the project. I should have looked further. |
Hi, I use stompkit to connect rabbitmq server , but i don't know how to use the vhost parameter,i want to know how to use the vhost parameter? thank you! |
@lifeng198931 Your question has no relation to this issue at all, please open a new issue if Otherwise - see https://www.rabbitmq.com/access-control.html for a discussion on vhosts (which also really has nothing to do with STOMP per se but is up to every specific broker to implement. |
Hi.
I have an issue where I am trying to connect to a host with a path (i.e: http://www.url.com/path_1/path_2/websocket) and STOMPKit does not seem to support this.
What I was going to try and do is send a "GET: /path_1/path_2" http header in the method:
completionHandler:(void (^)(STOMPFrame *connectedFrame, NSError *error))completionHandler;
The headers are a dictionary it that have to be key/value pairs, I need to send other headers like a token and a country but as you can see when I add my GET header like as the key and the value as blank (@{@"GET /path_1/path_2/websocket": @""} ) it does the following (predictably) although the GET header needs to NOT have the colon after it.
Token = 6d40c7d26a94c56b4b1ee001318bb7d7;
"GET /path_1/path_2/websocket" = "";
"CountryCode" = GB;
Is there any way I can modify StompKit to do this?
James
The text was updated successfully, but these errors were encountered: