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

WIP: Add support for http protocol requests #198

Closed
wants to merge 4 commits into from

Conversation

nechaido
Copy link
Member

@nechaido nechaido commented Jun 18, 2021

  • tests are added/updated for bug fixes and new features
  • description of changes is added in CHANGELOG.md

Currently, request to http://localhost/api would be transformed into requests to https://localhost/api, this will result in an obvious but hard-to-track OpenSSL error.

@nechaido nechaido force-pushed the add-support-for-http-protocol-requests branch from 90eb7db to c27a016 Compare June 18, 2021 13:19
@tshemsedinov tshemsedinov force-pushed the add-support-for-http-protocol-requests branch from 7629ab0 to 9cf2be1 Compare June 19, 2021 11:11
@tshemsedinov
Copy link
Member

Debased and simplified, ready for landing @nechaido

lib/client.js Outdated
@@ -92,7 +92,7 @@ class Metacom extends EventEmitter {
const target = interfaceName + '/' + methodName;
const packet = { call: callId, [target]: args };
const dest = new URL(this.url);
const protocol = dest.protocol === 'ws:' ? 'http' : 'https';
const protocol = dest.protocol.endsWith('s') ? 'https' : 'http';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tshemsedinov both ws and wss end with s that's why I used the check I used.

@tshemsedinov tshemsedinov force-pushed the add-support-for-http-protocol-requests branch from 7743daf to 9cf2be1 Compare June 21, 2021 18:52
@tshemsedinov
Copy link
Member

See client-side implementation: https://github.com/metarhia/metacom/tree/master/dist

@tshemsedinov tshemsedinov changed the title Add support for http protocol requests WIP: Add support for http protocol requests Jun 21, 2021
@nechaido
Copy link
Member Author

I'd prefer to have the same version for both node and browser clients.

CHANGELOG.md Outdated Show resolved Hide resolved
@tshemsedinov
Copy link
Member

Looks like not actual as of 2024-02-12

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

Successfully merging this pull request may close these issues.

2 participants