stomp-js / ng2-stompjs-angular7

n2-stompjs sample for Angular 7
15 stars 11 forks source link

How to connect to the server not as anonymous #34

Open jbdioli opened 3 years ago

jbdioli commented 3 years ago

Hello

I getting the connection to the server as anonymous. It works well. How now can I be connected to the server with a username, a pseudo, and not as anonymous ?

I'm trying to find documentation without success. :(

Thanks you very much for your help :)

kum-deepak commented 3 years ago

This example uses user/password guest/guest, which is the default in a new RabbitMQ installation (https://github.com/stomp-js/ng2-stompjs-angular7/blob/master/src/app/my-rx-stomp.config.ts#L10). Please set it as per your needs.

You may also need to set the host header if your broker needs it. Brokers may support other means of authentication as well (like tokens).

You may find the guide at https://stomp-js.github.io/guide/ng2-stompjs/ng2-stomp-with-angular7.html useful. This sample is the final output of the tutorial.