Giter VIP home page Giter VIP logo

adonis-websocket-client's People

Contributors

greenkeeper[bot] avatar idevelopthings avatar jericopulvera avatar okurichenko avatar reg2005 avatar romainlanz avatar thetutlage avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adonis-websocket-client's Issues

An in-range update of coveralls is breaking the build 🚨

Version 2.13.2 of coveralls just got published.

Branch Build failing 🚨
Dependency coveralls
Current Version 2.13.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As coveralls is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits.

  • 5ebe57f bump version
  • 428780c Expand allowed dependency versions to all API compatible versions (#172)
  • eb1b723 Update Mocha link (#169)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Websocket Babel Error Fix

This is the fix to the problem I see a lot of you are having with the WebSocket client and is not included in the docs. Just npm install and import babel-polyfill.

import Ws from '@adonisjs/websocket-client'

import Vue from 'vue'

// production change ws:// to wss:// for security
var ws = Ws('ws://localhost:3333')

ws.connect()

ws.on('open', () => {
      alert('Connected to server.')
})

adonis-websocket-client on android

adonis-websocket-client can use in website what if I want to use it on android? cause, I'm making web services for android and, I'm using socket chat, adonis-websocket is so good i like it :), but I can't use it on android, Is there any solution.

i want to use websocket client in android

Hello,
when i using this websocker client of socket.io on android Using java i cannot to connect the server
what is URI should i use to connect the server?
i'm using this websocket client 'http://socket.io/blog/native-socket-io-and-android/'

and this is my function in java (android)

private void connectWebSocket() {
        URI uri;
        try {
            uri = new URI("ws://localhost:3333");
        } catch (URISyntaxException e) {
            e.printStackTrace();
            return;
        }

        mWebSocketClient = new WebSocketClient(uri) {

            @Override
            public void onOpen(ServerHandshake serverHandshake) {
                Log.i("Websocket", "Opened");

                mWebSocketClient.send("Hello from " + Build.MANUFACTURER + " " + Build.MODEL);
            }

            @Override
            public void onMessage(String s) {
                final String message = s;
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        TextView textView = (TextView)findViewById(R.id.username_input);
                        textView.setText(textView.getText() + "\n" + message);
                    }
                });
            }

            @Override
            public void onClose(int i, String s, boolean b) {
                Log.i("Websocket", "Closed " + s);
            }

            @Override
            public void onError(Exception e) {
                Log.i("Websocket", "Error " + e.getMessage());
            }
        };
        mWebSocketClient.connect();
    }

Is that possible to adapt for React Native?

I have a React Native app with Adonis backend where I am implementing a chat system with Websockets, so I would like to use Adonis Websocket client as well.

I have an error to connect, as window.location.protocol and window.location.host don't exist without the browser.

Would be possible to handle the code to make everything work fine?

Thanks!

An in-range update of mocha is breaking the build 🚨

Version 3.4.2 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.4.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes fake-success

3.4.2 / 2017-05-24

πŸ› Fixes

πŸ”© Other

Commits

The new version differs by 7 commits.

  • a15b20a :ship: Release v3.4.2
  • fc802a9 :memo: Add Changelog for v3.4.2
  • 10ff0ec Eagerly set process.exitCode (#2820)
  • fc35691 Merge pull request #2818 from makepanic/issue/2802
  • 3e7152f Remove call to deprecated os.tmpDir (#2802)
  • e249434 Merge pull request #2807 from mochajs/npm-script-lint
  • 17a1770 Move linting into an npm script. Relates to #2805

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

WebSocket client for NodeJS

Hi,

How to use websocket client when running nodejs process? I'm creating daemon that will communicate via websocket (sending commands from GUI to daemon). Is there any way to use this library for that?

As far as I tested, it throws error on windows is not defined. I have found some workaround here: #67 (comment) but then I receive another issue: WebSocket is not defined.

Build

Hey! I can not understand what I have to do for getting it in my HTML file?
I've tried to use a code like that:
<script src="../node_modules/@adonisjs/websocket-client/dist/Ws.browser.js"></script>
but I've got:
image
Ok, I've saw a notice about polyfill but I just want to connect the build to my HTML and use it. I'm confused. What I have to do?

An in-range update of babel-loader is breaking the build 🚨

Version 6.2.10 of babel-loader just got published.

Branch Build failing 🚨
Dependency babel-loader
Current Version 6.2.9
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-loader is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v6.2.10

v6.2.10

Support for webpack 2.2-rc has been added in this release

πŸ› Bug Fix

  • If cache directory not writable, try to fallback to tmpdir before failing
Commits

The new version differs by 5 commits .

  • f221f6c 6.2.10
  • 3bbfbf5 Fallback for cache directories (#346)
  • 35272ef Add Webpack 2.2 RC as peerdependency (#348)
  • d264da0 Do not include comments in releases
  • f09bdd1 run clean on prePublish [skip ci]

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Initial presence state

With

channel('radio').on('presence:state', (user) => ...

I get only the list of users in a channel, after someone logs in. Is there a possibility to get the users directly?

Trying to close a channel and subscribing to it after throws an error

If I connect to a channel:

this.channel = ws.subscribe('channel');

Close its connection:

this.channel.close();

And then try to subscribe to the same channel after I closed it:

this.channel = ws.subscribe('channel');

The client throws an error with the message "Cannot join the same topic twice".

One would say: You can use getSubscription() to get the active subscription instead of trying to connect to it again. But the getSubscription() method doesn't return closed subscriptions.

Is this the expected behavior?

An in-range update of babel-core is breaking the build 🚨

Version 6.24.0 of babel-core just got published.

Branch Build failing 🚨
Dependency babel-core
Current Version 6.23.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-core is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of babel-preset-latest is breaking the build 🚨

Version 6.24.0 of babel-preset-latest just got published.

Branch Build failing 🚨
Dependency babel-preset-latest
Current Version 6.22.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-preset-latest is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

How to disable console output when bundling for production with VueCLI?

Vue-CLI-3's configuration uses double quotes instead of single quotes when defining process.env.NODE_ENV.

Currently the websocket client only checks for: process.env.NODE_ENV !== 'production' causing debug console logs to be pushed even in production environments for Vue apps.

The if statements in src/connection/index.js that allow debug logs to occur should also check for process.env.NODE_ENV !== "production" or have a debug option to disable these logs.

An in-range update of socket.io-client is breaking the build 🚨

Version 1.7.2 of socket.io-client just got published.

Branch Build failing 🚨
Dependency socket.io-client
Current Version 1.7.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As socket.io-client is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of babel-core is breaking the build 🚨

Version 6.21.0 of babel-core just got published.

Branch Build failing 🚨
Dependency babel-core
Current Version 6.20.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-core is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Reusing connection and auth problems

Hello,
not sure if it real issue, but you can't connect to channel with auth middleware after connection to public channel because the connection is reused and credentials not sent. I'm talking about this:

/** 
 * Do not connect again if already connected
 */
if (this._io) {
  return this;
}

/**
 * Sending authentication querystring when one of
 * the authentication method is being called.
 */
if (this._authQuery) {
  this._options.query = this._authQuery;
}

this._io = this._socketIoGlobal(this._url + '/' + this._namespace, this._options);

Error document is not defined when connect channel by nuxt

Hello,
not sure if it real issue, but you can't connect to channel it error document is not defined ('node_modules\adonis-websocket-client\dist\ws.js'). in here my code:

import Vue from 'vue' import ws from 'adonis-websocket-client' const wsVuePlugin = function (Vue, url, options) { Vue.prototype.$io = ws(url, options) } Vue.use(wsVuePlugin, 'http://localhost:3000', {})

export default { created: function () { this.$io.channel('chat').connect(console.log) } }

Disable console logs

i am new to nodejs and adonisjs and struggling hard to learn them, i am trying to use adonis web socket client and it is now working fine but i have one issue i am not able to remove console logs provided by default with adonisjs, can anyone please provide step by step instructions to remove console logs in browser

Adonuxt integration not working regeneratorRuntime is not defined

Hi I'm trying to use this together with adonuxt-boilerplate

nuxt.js

  plugins: [
    { src: "~plugins/ws.js", ssr: false },
  ]
 }

~/plugins/ws.js

import Ws from "@adonisjs/websocket-client";
const ws = Ws("ws://localhost:3333");

export default (ctx, inject) => {
  console.log(ctx);
  console.log(ws);
  // ctx.$ws = ws;
  // inject("ws", ws);
};

Error is
ReferenceError
regeneratorRuntime is not defined

Error preview server-bundler.js

exports.NuxtError = exports.createApp = undefined;

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var createApp = function () {
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ssrContext) {
    var _this = this;

    var router, store, app, next, route, path, inject;
    return regeneratorRuntime.wrap(function _callee2$(_context2) {
      while (1) {
                

Adonis WebSocket Client Example

Hi!

I'm new on NodeJS and AdonisJS but I really need an example of how to make a client (backend, not frontend) to connect to my AdonisJS websocket server. The AdonisJS + websocket server is OK.

Thanks!
Mauricio

Bower 'Failed to read' error

Hi. I'm trying to install adonis-websocket-client with bower but the missing comma from the #31 line of bower.json throws Failed to read error. I hope you fix it as soon as possible. Have a good day πŸ˜„

Unexpected token error when trying to import 'Ws'

Hi,

I am trying to run some client side sockets in electron to connect to an Adonis dashboard and backend. I'm getting the following error when trying to import the "Ws" package from node modules. Thinking it may have something to do with my project configuration but couldn't see anything that stood out.

  export default index;
  ^^^^^^
  
  SyntaxError: Unexpected token export
      at createScript (vm.js:80:10)
      at Object.runInThisContext (vm.js:139:10)
      at Module._compile (module.js:606:28)
      at Object.Module._extensions..js (module.js:653:10)
      at Module.load (module.js:561:32)
      at tryModuleLoad (module.js:504:12)
      at Function.Module._load (module.js:496:3)
      at Module.require (module.js:586:17)
      at require (internal/module.js:11:18)
      at eval (webpack:///external_%22@adonisjs/websocket-client%22?:1:18)

My repo is here in case you may need to check something in my app configuration https://github.com/jaymeh/time-tracking-electron.

I am including the package in "src/main/index.js".

Thanks!

VueJS and channel connect

When connecting to the socket without token query param and trying to connect to channel with withJwt() method - if fails.

Connection URL: ws://localhost:8081/socket.io/EIO=3&transport=websocket&sid=w9gDx_6eLxRiffcRAAAD

Result of connect to channel:
deepinscreenshot_select-area_20170918040316

But after refresh, the connection is with token query param and connection to the channel is ok.

Connection URL:
ws://localhost:8081/socket.io/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7InVpZCI6MX0sImlhdCI6MTUwNTcwMDE3NCwiZXhwIjoxNTA1Nzg2NTc0fQ.vA-4Cekta05M6IOKQiCXq42rLuf6wTA1qeGcWjK3bA0&EIO=3&transport=websocket&sid=HKc7o7ftvSxidnfSAAAB

Result of connect to channel:
deepinscreenshot_select-area_20170918040859

Maybe there is a option to reconect to the sockets with token in query?

I have this situation when user is going from guest to auth mode.
So from login page to dashboard page.

Access-Control-Allow-Origin

has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

when I try use with react display it, but my api work, in my file cors.js are * in origin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.