-
-
Notifications
You must be signed in to change notification settings - Fork 507
Fix websocket building on non standard ports - closes #2952 #2953
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
base: develop
Are you sure you want to change the base?
Conversation
Fix connection issue when intelowl is on nonstandard port
Hi @faux-eccles, thanks for your contribution! Next time request a review to me, in this way i'll be notified about your pr. I tried it on my pc, but I can see in the network tab the ws request is stucked in pending status with you change |
@drosetti Ah my bad, the screenshot was of the issue not the fix. Should have put it only on the issue ticket, and only had the fix in the PR. |
Don't worry about the screenshot, it's not a big deal. Even if it's correct the problem remains: in my env the websocket cannot connect from the frontend to the backend. Maybe I have to change ports in the container ? |
My change should be connecting to the same port that the page is serving from so if you can load the page it should connect. That being said in my environment the ports are changed in the container, I've shared a screenshot of my setup in the linked issue |
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
@faux-eccles Ok I changed the port on docker and it worked on standard port (80), but there is another problem: the UI environment is on port 3001, if you want to work on frontend this changes makes the websocket fail. I'd like to discuss with you a possible solution for this problem. I prefer to avoid to edit the docker conf because some contributors work quite often on the frontend and change it every time is quite annoying imho. |
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
@faux-eccles any updates on this? |
Changing the port in docker was a local config to run the service in my environment as port 80 is already in use and shouldn't be necessary for the fix itself. I don't have experience with hosting the UI separately to the backend service for developemnt which is what it sounds like @drosetti is doing. I think it would make sense to then dynamically build/set the port based on launch parameters. I can take a look to see what looks like. (also apologies for the slow responses, have just moved countries and in the middle of getting resituated) |
Looking into this a bit further this seems strange, my assumption is the npm proxy directive in package.json should be forwarding the requests along as with everything else. So in your environment hosting the react server on 3001, my changes should be connecting to localhost:3000/ws and NPM should forward the requests. I'll see if I can recreate locally |
Launching the npm dev server with the default configuration on this branch using the method outlined in the docs appears to be working as expected (besides some unrelated CORS errors that prevents me from actually submitting jobs to validate messages are coming through as the NPM server appears to just open a websocket connection regardless of the other end being available) Do you have the dev react app calling the api server directly and not via the npm proxy? ![]() edit: Fixed the 403 errors by setting the environment variable |
I've updated the package.json and added a middleware configurations for the react-scripts so that the webpack proxy correctly handles websockets. This might fix the need for having websockets on different ports while developing. ![]() |
Fix connection issue when intelowl is on nonstandard port
Description
Change the way the websocket address are built to ensure the hosts ports are being referenced. #2952.
Type of change
Please delete options that are not relevant.
Checklist
develop
dumpplugin
command and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zip
and you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERS
playbook by following this guide.url
that contains this information. This is required for Health Checks (HEAD HTTP requests)._monkeypatch()
was used in its class to apply the necessary decorators.MockUpResponse
of the_monkeypatch()
method. This serves us to provide a valid sample for testing.DataModel
for the new analyzer following the documentation# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.
Black
,Flake
,Isort
) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.tests
folder). All the tests (new and old ones) gave 0 errors.DeepSource
,Django Doctors
or other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules