fix: don't set base URL of SSE server #42
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this we would set the base URL of the SSE server to the
address of the HTTP server. This isn't quite right because the
address on which the server listens isn't always the same as the
one which the client connects to; for example, in Docker we might
set the address to 0.0.0.0 but the client will connect to localhost.
Since most clients will verify that the endpoint sent by the initial
SSE handshake matches the address of the server they connect to, they
raise an error when they see that
localhostdoesn't match0.0.0.0.This commit fixes that by just not setting the base URL at all. This
results in the initial message just looking like this:
which matches what the Python SDK does (see here, here,
and here), and fixes things for me when testing with Cursor.
Fixes #40.