Skip to content
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

QUESTION: How to proxy RxStomp connections #546

Open
jeanmelo25 opened this issue Dec 13, 2023 · 5 comments
Open

QUESTION: How to proxy RxStomp connections #546

jeanmelo25 opened this issue Dec 13, 2023 · 5 comments

Comments

@jeanmelo25
Copy link

jeanmelo25 commented Dec 13, 2023

Hi!
I'm Using RxStomp, I've unsuccessfully tried various configurations to proxy a broker connection from my local app to a remote backend server. Has anyone achieved this RxStomp proxy setup? Any guidance? Thanks!

My last proxy config

  "/myPath/core/ws": {
    "target": "https://my-remote-address",
    "ws": true,
    "secure": true,
    "changeOrigin": true,
    "logLevel": "debug"
  },
@mcpierce
Copy link

@jeanmelo25 I'm having a similar issue now. What I see is my server logging Completed 400 BAD_REQUEST each time my Angular app tries to connect to it via the proxy configuration.

Did you get yours to work and, if so, what did you do?

@jeanmelo25
Copy link
Author

@mcpierce It is impossible to test locally with rx-stomp. To do so, connect to another WS without rx-stomp, run tests, and then try with rx-stomp in a productive environment.

@kum-deepak
Copy link
Member

I am not sure which software you are using to proxy. We use Nginx to proxy rx-stomp connections. The instructions we used are at https://nginx.org/en/docs/http/websocket.html

In addition, I am unaware of any limitation of using rx-stomp for testing in a local environment. This project itself uses a broker running in a local machine during testing.

@jeanmelo25
Copy link
Author

I'm proxying to my backend in a productive environment directly from Angular served locally. It's simply impossible. I've tried multiple proxy configurations unsuccessfully.

@mcpierce
Copy link

mcpierce commented Feb 2, 2024

I am not sure which software you are using to proxy. We use Nginx to proxy rx-stomp connections. The instructions we used are at https://nginx.org/en/docs/http/websocket.html

For Angular apps, during development, you can tell the Angular server how to proxy connections to the backend services using a proxy configuration file like @jeanmelo25 describes in the original post. That proxying is so that you make changes to the code without having to do a full deployment to test the changes.

In addition, I am unaware of any limitation of using rx-stomp for testing in a local environment. This project itself uses a broker running in a local machine during testing.

In my case, I think the whole scenario is nearly working in that the Angular proxy is forwarding the packets to my backend server. We use this same setup in our existing implementation without issue. The problem only manifests when we try to replace our old implementation, which uses webstomp-client, with rx-stomp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants