Comments (6)
My problem was that I was sending "login,passcode,accept-version" in header, this is wrong, to CONNECT via STOMP it's a simple String.
let connectFrame = "CONNECT\n
login:admin\n
passcode:password\n\n\n\0"
```We just need to write socket.write(string: connectFrame)
from stompclientlib.
using username and password for login purposes is an essential feature. It would enhance the usefulness of this library much if it were documented somewhere. Not everyone will do a comprehensive search of open and closed issues just to find this feature.
from stompclientlib.
Hello @blinkmeoff,
Why are you trying to use a websocket just for login ?
Is there a must logic behind it?
You can use socket.send() method however I do not recommend that because you need to handle everything for yourself. Therefore, you do not need this library if you want to do that, you can simply use Facebook's Websocket and handle it on your own:
from stompclientlib.
STOMP 1.2 clients MUST set the following headers:
accept-version : The versions of the STOMP protocol the client supports. See Protocol Negotiation for more details.
host : The name of a virtual host that the client wishes to connect to. It is recommended clients set this to the host name that the socket was established against, or to any name of their choosing. If this header does not match a known virtual host, servers supporting virtual hosting MAY select a default virtual host or reject the connection.
STOMP 1.2 clients MAY set the following headers:
login : The user identifier used to authenticate against a secured STOMP server.
passcode : The password used to authenticate against a secured STOMP server.
heart-beat : The Heart-beating settings.
from stompclientlib.
At the end @blinkmeoff's business logic is fixed and it works :)
Closed <3
from stompclientlib.
I will add an example on the README :) Thank you for the suggestion @michaelpeternell
from stompclientlib.
Related Issues (20)
- Subscribe response HOT 3
- How can I access http response header (handshakeResponseHeaders) about handshaking? HOT 1
- Disconnecting after using autoReconnect HOT 15
- Add openSocketWithURLRequest connectionheader to websocket urlRequest's HTTPHeaderField and request additional connect function. HOT 4
- Cannot connect to socket HOT 3
- Error Domain=SRWebSocketErrorDomain Code=2132 "received bad response code from server 403" HOT 4
- Add method/flag to stop logging HOT 6
- Subscribe Issue HOT 3
- Version 2.0 HOT 12
- Received bad response code from server 403 HOT 4
- Error Domain=SRWebSocketErrorDomain Code=2132 "received bad response code from server 403" HOT 3
- Socket Disconnect after 30 min HOT 5
- misprint in code HOT 3
- Support for WatchOS HOT 2
- Swift Package Manager support? HOT 2
- Connection variable is not set to false when WebSocket receives DISCONNECT HOT 1
- Auto disconnection with error code 4500 HOT 2
- Facing Issue while sending the message HOT 1
- Privacy Manifest HOT 6
- Adding response after sent to server or not HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stompclientlib.