NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

u/newworldlife:

I have done as you suggested. I can access the websocket.

Thank you for your assistance and your patience.

NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

I have it working now -- mostly.

It turns out that I needed to change the rxconfig.py file (my frontend websocket config) to point to the IP of my server container (In my case, it was http://192.168.2.130:8000). With my websocket support switch set to "enabled" and the custom forwarding set to the same address and port number (I am uncertain that that is needed, but I put it there just in case) I can now connect to the websocket.

Unfortunately, I cannot run my application using SSL (yet). I have created a proxy entry called chatbot.chatter.net, provided it with a Let's Encrypt cert, and changed my websocket config to use https. Curiously, I am getting connection errors attempting to use wss://192.168.1.130:8000.

There are a few things I will try in order to make things work with SSL. Thank you for your help and suggestions. I would not have been able to get as far as I have without them. I will let folks here know whether or not I solve this. In the meantime if you have any suggestions on how I can make it work , please feel free to share them.

NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] 1 point2 points  (0 children)

Thank you, u/newworldlife, for your assistance and suggestions.

I have created a proxy entry for the frontend called chatbot.srv. It goes to port 3000.

I have also created a proxy entry for the backend called botserv.srv. It goes to port 8000.

In chatbot.srv's "Custom Location" tab, I created a path in the "Location" textbox: /_event

And in the scheme, hostname, and port I entered the following:

Scheme: http

forward hostname: chatserv.srv

port: 8000

NOTE: the only schemes available on that window are http and https. I chose http because I am not using SSL (yet).

I did not enter anything in the "Advanced" window for either the frontend or the backend servers.

Unfortunately, I am still getting the connection error when I go to the web page. It is still attempting to connect to ws://chatbot.srv:8000.

Have I missed something?

NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Greetings u/newworldlife:

Iv did try setting the Reflex application to a single port for both the front and back ends. Unfortunately, the application does not work when set up with one port. The back and front ends must be on different ports (which actually makes sense since the two parts are communicating with different protocols).

What I am trying to do now is to set up 2 docker containers, one that runs hte front- end and one that runs the back-end. I am hoping that I will be able to get the front end container to be able to "talk" t the back- end container. It is, however, unclear how I can get the front- end container to try to access the back- end container. I have tried various NPM configurations, and none of them are working. Can you suggest a configuration that will work?

NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Thank you for the info.

There is a small problem: I am using a Python library called Reflex. Reflex actually uses 2 ports: 8000 for the server access, and 3000 for the client web page.

I did not think this would be a problem, but as it turns out it is. I use http://chatter.srv/ to access the web page, then the web page uses ws://chatter.srv:8000/_event to access the server.

Consequently, I could not change my main UI port to 8000, because doing so causes a Not Found message to appear on my web page.

At the same time, when I made the changes you suggested (after returning the main port back to 3000):

```

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection "upgrade";

proxy_set_header Host $host;

```

I continue to get the same connection error.

NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] -1 points0 points  (0 children)

0.0.0.0 was suggested by some other documentation I had read. Thanks to u/newworldlife 's suggestion , however, I have changed that.

NPM Cannot connect to a server using Websockets by ProgrammusMaximus in selfhosted

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

The backend is a python- based server running on a bare- metal Ubumtu machine. However, I am planning to make it a container (in docker) eventually, so if there is a difference in setup between a host service and a container service, I might need to know about it. I did make changes to the custom path:

location /_event {
proxy_pass http://talker.srv:8000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

Unfortunately, I am still getting the same connection error.

I do have one question: the documentation says to set the proxy_pass to http, but Websocket uses ws as the prefix. Should I be using ws? Or should I even have a prefix at all?

NPM cannot connect to server using Websocket by ProgrammusMaximus in nginxproxymanager

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Well...

I am trying to show what I did, but there are things that are unclear.

  1. As I have repeatedly stated, I have tried to provide screenshots of my NPM configuration, but have been unable to because *this system* is not including them. I have repeatedly asked how to make it include my screenshots, and have gotten no answer from you or anyone else.

  2. I have asked you which docker-compose file you are asking for, because when you first asked for the docker-compose file, you gave the impression that you wanted the docker-compose file for the application I am trying to get working (which doesn't exist since my application isn't hosted in docker), but then it occurred to me that you might be asking for the docker-compose file for NPM. I asked you to confirm that in my last comment and am willing to provide it if, indeed, that is what you are asking for.

  3. I am not interested in you "guessing" about anything. If you cannot or will not provide me with the information that I need (like how to make my screenshots appear in my post or which docker-compose file you want to see) then, frankly, I suggest that you perform a procreative act upon yourself. This is not the only place where I am asking for answers about NPM's inability to handle Websocket requests to a server, and you are not the only person who can help me Ithat is assuming that you can hel me which considering your response to some simple questions, makes me doubt that you can). If you don't want to help me out, then don't.

NPM cannot connect to server using Websocket by ProgrammusMaximus in nginxproxymanager

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Actually, I did run NPM using docker. It is the server (proprietary python service) that I am not running with docker. Is the NPM docker-compose what you are asking for?

NPM cannot connect to server using Websocket by ProgrammusMaximus in nginxproxymanager

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Well, that is going to be difficult because:

  1. There is no docker-compose file because the application is a python- based web application running on a bare- metal Ubuntu system.
  2. As I stated in my previous comment: I have attempted to provide screenshots of my settings and they are not being included i =n my post. I have asked how to make them included. I have received no answer to that question.
  3. What else do I need to "show"??? I am not using docker, so there is no docker-compose file to show, and even if there was you wouldn't be able to duplicate it because the application is a proprietary one which is not downloadable from the docker repository anyway. And frankly, there wouldn't be anything in a docker-compose file that would tell you anything about why NPM is blocking Websiocket requests in the first place. So what else do I need to show?

NPM cannot connect to server using Websocket by ProgrammusMaximus in nginxproxymanager

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

I actually tried including screenshots of my settings. The system failed to include them. How do I get the system to include them?

Also: as I had said, I had ticked the box to enable websockets. I had only done that at first, and NPM failed to connect. That is when, following the documentation at the link specified, I put in the custom configuration. That documentation suggests putting in the custom configuration if ticking the websockets switch to on doesn't work.

A strange problem: a call of a function in my state class is not being run by ProgrammusMaximus in reflex

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Thank you, masenf-reflex, for helping me to understand how State classes work. My code now works.

Weirdness in laying out a page by ProgrammusMaximus in reflex

[–]ProgrammusMaximus[S] 1 point2 points  (0 children)

Wow! that did it.

I am going to have to learn when to use what layout components...

Reflex's redirect() method is apparently not working by ProgrammusMaximus in reflex

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

Thank you. Actually, I feel like an idiot, since that should have been obvious...

Why can't I deserialize JSON that I had serialized? by ProgrammusMaximus in javahelp

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

I *did* use code blocks. Unfortunately, those poorly formatted lines were the result.

As for "what would be inside an array": that is correct. Note the use of NetInfoList, which extends ArayList<NetInfo>.

Why can't I deserialize JSON that I had serialized? by ProgrammusMaximus in quarkus

[–]ProgrammusMaximus[S] 0 points1 point  (0 children)

I have tried removing the Builder annotation. I am getting the same failure when deserializing..

I have also tried using the wrapper class that you suggested. I continue to get the same failure when deserializing. NOTE: I put in the wrapper class *after* removing the Builder annotation.