how can i access mail from a microsoft exchange server using javascript? - javascript

I am trying to build a desktop app using electron that retrieves mail from a specific mailbox (microsoft exchange server), now, i have looked around and read that mailbox connection should be done server side (the question was made by a guy building a web based app that is a little bit similar to what i want to do), but, since i am not really deploying a node js server but rather using electron, which, as far as i understand is like a desktop app version of node, im not sure on which approach to take. Should i use an api? does microsoft has any interface for this? or should i use a third party integration for it?

It looks like the Exchange Web Services API is only provided as a CLR assembly, so if you wanted to use it you'd need to:
write a C# console app that you then spawn from your Electron app
(and communicate via stdin/stdout), or
use the EWS API in your Electron app via Edge.js
Alternatively, you could probably just directly communicate with the exchange server using SOAP messages, but that could be a bit tedious to implement.

Related

Accessing Bloomberg API from client's browser in javascript

Is it possible to access blpapi from javascript running in the client's browser?
I wish to access bloomberg's API from javascript running in the client's browser, in the assumption that the client has an open bloomberg session and therefore bbcomm is running.
Conceptually, this would be the same as accessing the blpapi on the client side from python.
However, all existing solutions I found in js appear to be server-side:
blpapi-node (node-based)
blpapi-httm (creates a server where to post http request)
blpapi-react (cannot make this module work)
Now you can access Bloomberg data natively in JavaScript via Web AppPortal. This allows you to write web based applications that run inside LP Components.
To learn more about Web AppPortal, go to MYAP 5
To download the SDK, please type SDK -> select SDK -> AppPortal Web SDK -> click Install.
This is obsolete, see Mourad Barakat's answer above
Conversation with Bloomberg Support confirms this is not possible**
BB say they don't support javascript access, and that one solution is to use their Server API to use the authentication of the client (who has a bb terminal open) to query data and return it to the client
An alternative hack
An alternative hack is to create an executable mini-server that the client downloads and launches, and that offers an http interface to get data to the webapp.
For example, this could be done in Flask in Python, and in fact it has already been done by blpapi-web (excluding the executable part, for which you can use PyInstaller and py2exe for Windows and py2app for Mac)

run node.js server for chat app in e-commerce website

I want to add a chat app to my e-commerce website which offers one-to-one chat between the buyers and the sellers. After searching ,web sockets seems to be right for this but it requires node.js server and the rest of my website is in php with apache server. I have read that it is not good to run both apache and node server at the same time. For video chat I'm using appear.in's javascript api which has no such limitations.
How can I run the node.js app under this scenario?
There are plenty of web socket libraries for PHP, e.g. Ratchet.
If this is the only reason for you to move parts of you application to Node.js, you shouldn't necessarily do it.

LDAP authentication for a HTML/JavaScript application

I am building a HTML/JavaScript application using AngularJS. It doesn't have a backend except some Perl scripts that spit JSON through a URL through which I display the data. One of the pages on this dashboard needs privileged access for which I had to add LDAP authorization.
The application is deployed on a WAMP server. Active directory is being used in the organization; but I am not quite sure how to establish the authentication in a pure html application without a backend. What is the usual process followed to handle such authorizations and how to achieve it?
You should write a web service (REST) in any language you want (JAVA C# PHP Node.js ...) who autenticate against your Open LDAP server and you'll consume it in AngularJS.
It's quite a classic problem.
Appears to be a perfect candidate for OpenID Connect. Use one of the many available libraries available.

direct client-to-client message

I have been working with node.js for a while, now when I'm looking deeper into it, for a chat aplication instead of sending message as client - server - client, there must be some possible ways for direct client to client message sending?
Browsers tend to communicate with servers via HTTP. Some implement other protocols, like websockets & SPDY, but again, these are mostly client-server protocols.
Some plug-ins (like Flash & Java) can open ports and communicate client-client. (AFAIK, haven't actually used them.)
Chrome is the only browser I'm aware of that can (soon) open TCP and UDP sockets from Javascript and do direct client-client communication. At the moment normal web apps can't do this, your app needs to be run as a "Chrome Packaged App", with a special manifest file.
Here are the docs, a blog post describing the feature and a browserify module that can behave like the net node.js module in the browser.
EDIT: This should probably not be tagged as [node.js] since you're trying to run in browsers (not in your node vm), this is a Javascript / Browser question.
This is maybe out of date question, but take a look on PeerJS.
It requires server only as a connection manager (broker). But all communication is done between clients directly.
This does not have anything with server. If you need something like that and if clients are flash you can use RTMFP . For JS i google this library which is js bridge for RTMFP, I dont know how it works. At the end you can write you own library to chat beetween clients but this is much harder(IP addresses are behind NAT, etc...)
I think answer for your question is here
PS Also exist open-source in-browser server which written using JS, but I didn't google it quickly. If you find it, please notify me.
If you just don't want to write your own server you can use:
https://httprelay.io
Use AJAX calls to communicate between peers.

Socket reading and writing from a web browser app

There is a server I need to talk to that publishes a protocol over TCP/IP for querying data from a database and listening on a socket to receive notifications when data is updated. The sever guys provide a Java API which uses this TCP protocol. This means I could easily write a Swing App to talk to this server.
I would like a browser based solution. As the protocol is known to me, could I do this in JavaScript? My app will have to display the data in a table. I have heard of Web Sockets but I'm not sure if it will allow this two way communication. Is it feasible? Is there a better way that is cross platform and will work in most browsers? Should I be considering a Java Swing based solution that runs inside a browser?
EDIT: What about changing the code in my C++ server to add an additional interface that my Javascript code can communicate directly with it?
The WebSocket protocol differs from TCP/IP sockets. You will have to write something to link them together.
You can do this perfectly well in JavaScript: use Node.js. There's enough tutorials to be found on the subject. The best way to link it to your in-browser JS is through Socket.IO.
Create a Node.js server that connects to the api
Make the server talk to your web app
Use it :)
This will work cross-platform and cross-browser (Socket.IO can use/emulate websockets even on IE6(!!)). You'll have to run a server-app (the Node.js app) though.
My personal opinion is that if you want a web/browser based solution, you should use native technology, and not Java.
Hope this helps :)

Categories