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

connectWebSocket broken since 0.8.5 #2320

Closed
WebFreak001 opened this issue Jun 7, 2019 · 0 comments
Closed

connectWebSocket broken since 0.8.5 #2320

WebFreak001 opened this issue Jun 7, 2019 · 0 comments

Comments

@WebFreak001
Copy link
Contributor

import vibe.vibe;

void main()
{
	auto ws = connectWebSocket(URL("wss://echo.websocket.org"));
	ws.send("test");
	logInfo("got back: %s", ws.receiveText());

	runApplication();
}
object.Exception@/home/webfreak/.dub/packages/vibe-d-0.8.5/vibe-d/http/vibe/http/client.d(87): URL schema must be http(s).
----------------
/usr/include/dlang/dmd/std/exception.d:515 pure @safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, scope const(char)[]) [0x55a310ccfd7e]
/usr/include/dlang/dmd/std/exception.d:436 pure @safe bool std.exception.enforce!().enforce!(bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0x55a310ccfcfa]
/home/webfreak/.dub/packages/vibe-d-0.8.5/vibe-d/http/vibe/http/client.d:87 @safe vibe.http.client.HTTPClientResponse vibe.http.client.requestHTTP(vibe.inet.url.URL, void delegate(scope vibe.http.client.HTTPClientRequest), const(vibe.http.client.HTTPClientSettings)) [0x55a310db9796]
/home/webfreak/.dub/packages/vibe-d-0.8.5/vibe-d/http/vibe/http/websockets.d:91 @safe vibe.http.websockets.WebSocket vibe.http.websockets.connectWebSocket(vibe.inet.url.URL, const(vibe.http.client.HTTPClientSettings)) [0x55a310db400a]
source/app.d:5 _Dmain [0x55a310cb25ec]
Program exited with code 1

the bug probably got introduced with #2265

Changing wss/ws to https/http will probably work but other methods are expecting wss and ws and will probably not work correctly with https! Also the API I'm currently using returns wss/ws URLs and I don't want to modify them just to workaround a regression.

dlang-bot added a commit that referenced this issue Jun 15, 2019
Fix wss/ws websocket connection fix #2320
merged-on-behalf-of: Sönke Ludwig <[email protected]>
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

1 participant