Giter Site home page Giter Site logo

jxm's Introduction

Evented I/O for (Chakra, SpiderMonkey, V8, and..) JavaScript

JXcore extends Node.JS™ with additional features for developing mobile and embedded applications using JavaScript and leveraging the Node ecosystem.

Master build status: Build Status

Important Notice:

Nubisa halting active development on JXcore platform

You may alternatively try https://github.com/janeasystems/nodejs-mobile

Features include

  • Support for core Node.JS features
  • Embeddable Interface
  • Publish to Mobile Platforms (Android, iOS ..)
  • Supports Multiple JavaScript Engines
  • Multi-threading Capabilities
  • Process Configuration & Monitor
  • In-memory File System
  • Application Packaging
  • Support for the latest JavaScript features (ES6, ASM.JS ...)
  • Support for Universal Windows Platform (uwp) api

Which architectures are supported

  • ARMV7, ARMV7a, ARMv8 (64 bit**)
  • MIPS
  • ia32, X64

Coming soon;

  • Power7, Power8, MIPS (64 bit)

Which platforms are supported

  • Android 2.3+
  • CyanogenMod 10+
  • iOS 6+
  • Windows XP+
  • Various Linux Distributions (Debian, Fedora, Suse, OpenWRT, Gentoo ...)
  • BSD
  • OSX

Test environment

  • Ubuntu 14 LTS VM
  • Debian 7 VM, Ci20(mips), RP B+(arm), RP 2(arm), VM(osuosl - power8)
  • Udoo (arm + arduino)
  • FreeBSD 10 VM
  • Windows 7 x64, 8.1 x64
  • OSX 10.9, 10.10
  • Android 2.3 Samsung ACE
  • Android 3.x Samsung Galaxy Tab2
  • Android 4.x Huawei G510 /LG G2 / HTC 820(armv8) / Dell Venue 7 / Ci20(mips)
  • Android 5.x Nexus 5 / Nexus 6 / S6
  • Cyanogen 11+ one plus one
  • iOS 6.x iPhone 4s
  • iOS 7.x iPad Mini 2nd, IPhone 5s
  • iOS 8.x iPhone 6
  • OpenWRT VM, Yun(mips)

Roadmap

See Roadmap document.

To build:

See How to Compile document.

To install:

If you don't want to build JXcore by yourself, you can use pre-compiled binaries. See Installation document.

Start hacking the native core:

Macro API is available from here

To run the tests:

See Testing document.

JXcore Contributors

Our hardworking contributors are available from here
Would you like to be one of them? Fork, Hack, and send a Pull Request.

Node.JS authors list:

List of Node.JS contributors can be found from here

** compatibility mode

jxm's People

Contributors

brunobg avatar dbg981 avatar karaxuna avatar obastemur 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jxm's Issues

client callback signature

Would it be possible to pass in an error to the subscribe()/unsubscribe()/call()/etc. callbacks if the particular request is not successful for one reason or another? That would be much better than keeping a bunch of state that needs to be checked inside OnError.

Errors in chrome-android

I get these errors in chrome-android:

POST http://192.168.1.100:2000/myapp/jx?co=1440544322111&io=1 404 (Not Found)
jxcore._Send @ jx?ms=connect:1002
jxcore.Listen @ jx?ms=connect:420
(anonymous function) @ jx?ms=connect:537

The exact same page is fine in chrome-desktop. It's odd that it's trying to connect to port 2000 (where the http server is) instead of port 2666 (where jxm server is).

/myapp/jx/?ms=connect is loaded correctly and has this: window['jxcore'].ListenUrl='/myapp/jx';

I'm also configuring this

server.setConfig("IPAddress", CONFS.server);
server.setConfig("httpServerPort", CONFS.jxmServerPort);

Any ideas why it's not working in android?

Disconnect event on the server

Is there anyway that the server may know a client disconnected? Not only a regular close(), but a "the dog chew my network cable" too?

UTF-8 encoding does not work

Hi,
I'm currently evaluating JXM as a messaging backend for our Online-Campus. Unfortunately it seems that the UTF-8 encoding for the messages does not work correct. When I send german umlauts (e.g. ä, ö, ü), I receive hieroglyphs.

You can re-produce this with your server-side-subscription example. Changing the "Hello from browser" message in index.html to "Hello from browser ä ö ü Ä Ö Ü", then reload the webpage and click the "start"-Button and you will see that the characters are not getting displayed correct.

By the way two more questions:

  • How stable is JXM at the moment? I know JXCore is tagged as beta, but would you already use JXM in a production system (knowing that the API can change in the future)?
  • What are you're plans for the Java-Client? Will it receive ongoing support and development?

Thanks in advance for your answers,
Kai

Client side unsubscribe lead to an "Uncaught Reference Error: jx_obj is not defined"

Hi,
I'm running into an uncaught reference error while trying to unsubscribe from a channel. I can successfully join the channel, send a message to the channel and also call a server side method, which sends a message back to the channel. But when I'm trying to unsubscribe from the channel, I get the following error:

Uncaught ReferenceError: jx_obj is not defined in line 170 of jx?ms=connect

I'm running version 0.3.6 of jxm on node 0.10.33.

Kai

How to send a message to a specific client?

How can I send a message in JXM from a Java Client to another Java Client with a specific userID in a channel instead of the whole group? I am referring to something similar to this (ex. from Socket.IO):
var socketid = users[userID];
io.sockets.socket(socketid).emit('for your eyes only');

Is it possible with JXM?

Cheers

Openshift close listen debug

I tried my best to open jxm on OpenShift results were unexpected error returns listen AECES

jxm.io v0.3.9
HTTP -> http://127.12.248.1:8080/
events.js: 72
        throw er; // Unhandled 'error' event
              ^
Error: listen EACCES
    at errnoException (net.js: 905: 11)
    at Server._listen2 (net.js 1024: 19)
    at listen (net.js: 1065: 10)
    at Server.listen (net.js: 1139: 5)
    at Object.exports.startServer (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server.js:268:16)
    at Object.rabbit.OnConnected (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:169:17)
    at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_rabbit_api.js:134:21)
    at Object.exports.Start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jx_server_events.js:174:12)
    at Object.exports.start (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/node_modules/jxm/backend/jxm.js:327:39)
    at Object. (/var/lib/openshift/563b86a389f5cf62c400021e/app-root/runtime/repo/server.js:16:8)
DEBUG: Program exited with code 8 node server.js
DEBUG: Starting child process with 'node server.js'


var server = require('jxm');

server.setApplication("kjnw89dfho2j3bfoweyhf892h", "/", "908j1n23okdnwqe98hf2oi3ubrowehf98wehroi24bfoiqewhf08293hr09243hbre8hfi0owehf420ith20");
var server_port = process.env.OPENSHIFT_NODEJS_PORT || 8080;
var server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1';

server.addJSMethod("serverMethod", function (env, params) {
server.sendCallBack(env, params + " World!");
});

server.linkResource("/", ["index.html", "text/html" ]);
server.on('request', function(req, res){
return true;
});

server.start({address:server_ip_address,port:server_port });

upgdrade amqp / loadash depenency

While installing jxm I get the warning:

npm WARN deprecated [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0

The lodash module is used by amqp.

Nothing serious, but we may try to upgrade the dependencies to newer versions at some point.

helloworld - not invoking callback on client safari mobile

I tried to run the helloworld.js example - while running it on desktop Safari works, running it on safari-mobile doesn't - it looks like the server is falling to invoke the client callback.

This seems to be the same case for the chat example....

Howto disable WebSocket-Support in JXM?

After I moved our new JXM based messaging backend to our test server, I got the following error in the clients browser console (IP-Address was removed by myself):
WebSocket connection to 'wss://xxx.xxx.xx.xx/channels/jx?c=699aNaNaxT0@1113650' failed: WebSocket opening handshake was canceled

The cause is our Apache Webserver 2.2 in front of our system and the missing mod_proxy_wstunnel module, which is only available for Apache 2.4. So in the long run we will update our system, but in the meanwhile I want my colleges to test the current implementation.

So I searched for a configuration option for the connection mechanisms. What I found was jxcore.SocketDisabled = false; in backend/jx_browser_client.txt. After I set it to true, the error disappears, but unfortunately neither the jxcore.OnSubscription nor the provided callback function got invoked in the clients browser after this change. :(

When I set jxcore.SocketDisabled back to false, everything works as expected.

Is there a way to disable the websocket functionality and fall back to long polling?

Thanks in advance for any help,
Kai

JavaScript client send rate needs improvement?

This applies just for client -> server direction.

I was rubbing my eyes and I couldn't believe, that JavaScript JXM client has a very low send rate: 1 message per 10 ms. This is due to SendChecker() being called by setTimeout(..., 10). SendChecker() sends only one message per call. I've tested it, I've seen it.

Do we want to improve that part?

How to define customMethod for sentToGroup call?

Hi,

I am wondering a bit about where I have to define the customMethod for the sendToGroup function? Specifically, I am referring to this part of the documentation in Java API Client:
SendToGroup(String groupName, String methodName, Object params)
Sends message to all clients, that have already subscribed to the specific groupName. The message is passed as params argument to the target's method named methodName.
The "addText" method should be available on every client, which is subscribed to programmers group. While invoking the addText method at each client, the server will pass "Hello from client!" as an argument: client.SendToGroup("programmers", "addText", "Hello from client!");

However, if I define a public void customMethod() inside of my java file, I always receive that the method could not be found: xm.Client@fd2c076: Method customMethod wasn't exist on target object.: Critical

Where and how do I need to define this customMethod that is invoked by each client?

Thanks for your help!

Memory leak ?

Hi,

In i'm writing a jxm client app in node i noticed a memory leak issue (the process memory increased to 500MB+ in a couple of hours)
Using heapdump and Chrome Dev Tools i traced it to
jx_obj.RequestList.s in jxm_client.js which kept growing.
I also verfied this by debugging the app.

Looking a bit inside the code i didn't find any obvious way that array was being trimmed.

Here's a quick fix i came up with to make my app work:

backend/jxm_client.js:

Line 24 - made s an object instead of an array (there are no obvious array methods used on it)

jx_obj.RequestList = { s: {}, l: {}, sc: 0, sn: 0, ready: true, force_false: false };

Line 440 - appended delete line to delete used requests

    if (jx_obj.SocketOpen) {
        jx_obj.Socket.send(jx_obj.RequestList.s[call_id].message);
    } else {
        jx_obj.SFirst.push(jx_obj.RequestList.s[call_id].message);
    }
    delete jx_obj.RequestList.s[call_id];
    return true;
};

Line 503 - appended delete line to delete used requests

    if (jx_obj.RequestList.s[call_id] != null) {
        txt.push('ms=' + jx_obj.RequestList.s[call_id].message);
        delete jx_obj.RequestList.s[call_id];
    }

Maybe only deleting the message after jx_obj._Send(_pool); at line 237 would have been enough.

My app connects to server, subscribes to multiple groups (by calling server custom method) and starts pushing messages to those channels.

Is there a better way to avoid this issue?

redicilous

I have so many problems with jxm it's getting ridiculous...
Maybe you know why this one's happening:
If a mongodb db is empty, the program crashs.
No error msg, no logs, NOTHING.

I have plenty of code to handle this kind of scenarios, and also timer to check the db every once in a while.

Btw, like always, running the same code through node app.js works fine.

Running Chat sample from remote server - socket cannot connect

I'm trying to run the chat example on a remote server, but the websocket is not connecting -

WebSocket connection to 'ws://0.0.0.0:8000/chat/jx?c=702a126251axT0@1112126' failed: Connection closed before receiving a handshake response

How do I change the ws address to my remote url?

Cannot call sendCallBack multiple times for the same client

I have a custom method at my server, something like:

var clientNames = {};
server.addJSMethod("logged", function (env, physicalId) {
      clientNames[physicalId] = env;

Inside this method I need to send some data to the calling client, but this data Needs to be sent in different calls, pseudo:

var params = {
    method: 'callback1',
    data: {}
};
server.sendCallBack(env, params);

params = {
    method: 'callback2',
    data: {}
};
server.sendCallBack(env, params);

The problem is that the client receives only the last sendCallBack call (the one with "method: 'callback2'"). So, this is expected? how can I send my data to this client without being tied to a single point?

jxm have background in CloudFlare?

Hello people support!
I am not fluent in english language. Your can answer questions like the title I wrote for determining jxm versatility, I very much hope the answer will be able to run offline in CloudFlare.

How to retrieve Object Values from Callbacks in Java Client?

Hi,

I am using NodeJS as Server side and Java Client as Client side and would like to sent a JSONObject from Server side nodeJS via Callback to JavaClient. I know that I have to use
call function for that (as shown below) and retrieve my sent values through the Object arg.
However, from this point on, I don't know how I get the values. The data is coming in checking logcat but I do not know how to retrieve the values out of the object arg.

So my questions are:
When I sent my data from Server side, how do I retrieve my data through the object in the call function? When I check for the value I get something like this jxm.Client$JSON@49c155b, how do I cast this to something that I can use?

// Callbacks
final Callback callback = new Callback() {
@OverRide
public void call(Object arg, Integer err) throws Exception {
System.out.println(arg.toString());
});
};

Thanks in advance for your reply!
Benedict

Add callback for server.start() or trigger event "start".

At the moment as far as I understand when you call server.start() there is no way to get notified when the server is started. Is it possible to add one of the following features?

  1. add a callback function to server.start() that gets called when the server has started
  2. add an event (server.on("start")) that gets triggered when the server has started
  3. return a promise when calling server.start()

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.