View incoming http requests using ETW - etw

I would like to monitor incoming http requests using ETW?
I`m having trouble finding a provider to subscribe to?
Keep in mind that I am noob with ETW.
Any documentation or ideas are welcome.
Thanks
EDIT
Looking at the Microsoft-Windows-HttpService provider - what event would I suscribe to?

Related

How does google docs do real time syncing? Websocket?

Applications such as google docs and notion can sync in realtime.
How is this achieved? I know websocket can do something like this.
But I didn't see any websocket traffic in the developer tool. Instead I saw get and post requests. How can this be achieved with GET/POST request?

Sending data from one domain to another through websockets

I'm using Socket.IO to attempt to transfer information from one domain to another... is that possible?
I want to send data upon a POST request to one domain to another domain...
I have a successful connection on the receiving end, but am having trouble with the sending end. Any suggestions?
Thanks!
Yes. According to socketio documentation, it is possible to make cross domain connections irrespective of the browser.
[http://automattic.github.io/socket.io/#faq]
You can directly connect to the server ( sending end ) from the client via io.connect and there is nothing special you have to do in the server side code.
This link may be helpful in handling POST requests. http://showmetheco.de/articles/2011/8/socket-io-for-backend-developers.html
Also, it would be really nice if you can post what kind of issue you are running in to in the sending side.

REST API chat - endpoint for real-time fetching messages

I have a REST API server powered by express+mongodb. There are a couple of endpoints with different resources. One of them is chat API. I already have several basic endpoints like:
POST http://api.example.com/v1/chat - to create chat
POST http://api.example.com/v1/chat/:id/message - to send message to existing chat
GET http://api.example.com/v1/chat/:id/messages - to get messages in the the specified chat
But I need to provide a way for API consumers to efficiently get new messages in real-time without reloading the page.
For now as you see it's possible just to poll GET endpoint from client but it seems not performant. For example client can have UI which will show new messages count in header (some kind of notifications).
I was thinking about websockets. Is it possible for example to provide endpoint like /chat/:id/subscribe which will proxy sockets' server and connect to it on client?
Is there some good examples of such API design where I can get inspiration from or maybe you can give me piece of advice? Thanks!
socket.io is the package you are looking for.
The namespace section in it's documentation is a good solution because namespaces can be authorization protected. It represents a pool of connected sockets.
Here is how I would do it :
Create a document for the chat between the two users with this route :
POST http://api.example.com/v1/chat
Create a namespace with socket.io when a user sends a message to another connected user and store it into your user's document in your database. This route would create a namespace and/or emit the message :
POST http://api.example.com/v1/chat/:id/message
In the client, you have to use socket.io again to listen to the messages in the namespace.
UPDATE FOR SCALABILITY :
Here is a good stackoverflow answered question about implementing a scalable chat server : Strategy to implement a scalable chat server
As you can see in this post, mongodb might not be the best solution to store your messages.

What are webhooks in the BugHerd API and how can they be created?

I'm currently working with the BugHerd API.
Please suggest how to create webhooks. I have google understand they are new functionality in apis and they used for two way communication.
They're a way of asking a remote server to make a request of your own server when events happen on the remote server. They allow you to receive real-time events without constantly polling the server. They're basically callbacks that happen between two severs over HTTP.
As for creating them, the API is pretty clear. Make a post request to POST /api_v2/webhooks.json and include JSON in the following format:
{
"project_id":1,
"target_url":"https://app.example.com/api/bugherd_sync/project/1/task_create",
"event":"task_create"
}
You're telling it which event to hook into, and which URL their server should contact when the event occurs.

protocol comparison for notification server with node.js

I'd like to implement push notification server using node.js. The basic scenario is:
Some applications sends notification messages to the server.
Notification server receives the request and forwards the message to uesr's mail or IM client based on user's preference.
In step 1, which protocol (e.g. REST, socket, HTTP/XML and so on.) would you recommend from the performance perspective?
Also in step 2, I have a plan to use node-xmpp module for IM client but for mail, which way is the best to implement? For example,
Just use SMTP. (But I think this might occur performance degradation because SMTP is an expensive communication and performance depends on SMTP server capacity.
use queue mechanism, in order to avoid drawbacks from the above. node.js app simply puts the message into the queue, and smtp server pulls the message.
other solutions...
Thanks in advance.
With regards to what to use as a protocol, i would go for a REST interface, whereby the application posting sends a POST request to a resource associated with the USER. something along the lines of "http://example.com/rest/v1/{userID}/notifications
I personally would use json as the data/content of the rest request and have node.js write this information to a message queue. (as a json string).
You can than have xmpp readers for each user, as well as an SMTP handler reading from this queue as fast as the SMTP server allows it to go.
However, this full post is what i would do in your situation, rather than a factual response on what is best. I know JMS fairly well and i've been working a lot with rest interfaces lately, therefore this is the way i would do it.

Resources