-
Notifications
You must be signed in to change notification settings - Fork 84
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
externalPort check cannot be disabled (as the testsuite uses old autobahn ..) #128
Comments
what these checks are related to "same origin" policy in websocket, and https://github.com/crossbario/autobahn-python/blob/359f868f9db410586cf01c071220994d8d7f165a/autobahn/websocket/protocol.py#L2686 |
I'm writing a wrapper over several web socket implementations, and using Autobahn TestSuite to verify that my wrapper behaves correctly. So this varies quite a bit:
I have also a couple implementations for the browser, nodejs, and native which might send something different, but it should be along the same lines.
This is sort of my case, because I don't control the dynamic external port used for the container, I only know I map it to 9001. |
nope, I don't think so, but not setting the externalPort should deactivate the port check altogether (https://github.com/crossbario/autobahn-python/blob/359f868f9db410586cf01c071220994d8d7f165a/autobahn/websocket/protocol.py#L2686) - hence I was confused why it fails! after a bit of digging, turns out the Autobahn-Python which the Autobahn-Testsuite uses is an older one (frozen to keep results static), and lacks this patch crossbario/autobahn-python@80fe02d this patch was done to fix this on autobahn trunk, but the old autobahn used in the testsuite fills externalPort automatically from the websocket URL defined in the testsuite server spec - and that has port 9001 and because of that, the port check will run and then fails:( |
Thanks a lot for looking into this! 🙏 That explains it.
Does it mean it will never be upgraded? Or is there a chance this will be fixed in future versions of the test suite? |
There are 2 aspects from my PoV:
|
Thanks for taking the time to answer this anyway. Both points are very fair. You seem quite exhausted about this project. I hope you'll be able to pass the flame or at least share the burden of maintenance. |
As for this issue, I'm not sure I have any way to work around it 🤔 I believe I will eventually implement my own test server as an alternative to Autobahn TestSuite. |
oh yes, that is true;) looking back, maybe I should have spend my time differently.
you could fork autobahn 0.10.9 https://github.com/crossbario/autobahn-testsuite/blob/master/autobahntestsuite/setup.py#L88 then backport the patch I linked above, and then direct to build the docker image from that autobahn-testsuite/docker/Dockerfile Line 30 in 09cfbf7
should be doable in 1-2 hours. developing your own testsuite from scratch: sure, but tbh, it'll be lots of work and how can you compare results with other implementations? anyways, good luck! |
Thanks for the detailed suggestions ❤️ I might give it a go.
I technically don't have the same goal. I don't intend to compare "my" implementation to others, nor even to the spec itself. I'm just writing adapters of various implementations from different Kotlin target platforms and building a multiplatform library on top of that. My only goal with the testsuite was to test if I didn't mess up the adapters, but not really to verify that the adapted implementations (which are not mine) are 100% spec-compliant. So technically I don't need an extended test suite for all aspects of the RFC. Also, I sunk many hours trying to get Autobahn Testsuite to work in my project, as it had many ramifications into other areas. There is no real doc about how to run test cases, which required me to read and understand Autobahn testsuite's code (being a Python noob). Also, it requires either a python stack setup or Docker, and the python setup seemed quite complicated (I wanted to have an easy local setup on my dev machines and easy setup on CI too), and outdated (no Python 3), so I opted for Docker. But then Docker is a pain on macOS GitHub Actions runners (killing my CI time, although that's getting better lately with colima support), and is still preventing me from using windows runners at all. Then running Autobahn in a docker-compose from Gradle as a service for my unit tests was also kind of a pain (because the existing plugin is written poorly). Anyway, all this to say that this compounded into a lot of wasted time, every time getting me closer and closer to giving up and writing my own server. This issue is kind of the straw breaking the camel's back :D PS: Sorry for the wall of text! And sorry because this doesn't really have its place in this GitHub issue 😅 |
I'm running the Autobahn test suite server in a docker container (actually I may run multiple Autobahn test suite servers on the same machine). The external port through which I communicate is different from 9001 (because I can't have all test servers running on 9001).
However, the tests immediately fail during handshake with the following HTTP 400 error:
The
Host
header is supposed to be the one used to connect to the server, so it should be expected that theHost
contains the port 53701. Why is the test failing?The text was updated successfully, but these errors were encountered: