Hi developers,
Many of you asked me about the possibility to setting in a request a HTTP headers that are prohibited in XHR. The spec for this object prevents setting headers like User-Agent, Proxy-*, Accept-Encoding etc. I couldn't do much about it, until now.
I'd like to introduce the socket-fetch library that I've made for Advanced Rest Client. It is an implementation of a HTTP client that is using chrome.sockets.tcp API and create connection directly on socket. This means that the app will no longer have any limitations from transport specification (either Fetch or XHR API). It gives you more control over what you are sending to the server and makes the app even more powerful tool for API testing.
Showing posts with label sockets. Show all posts
Showing posts with label sockets. Show all posts
Monday, 22 February 2016
Monday, 22 October 2012
Testing sockets
Since latest version of the application you can test socket messaging as well. It is simple implementation of the web socket API.For server implementation you can use for example the ws module for node.js.
Below is sample server side code:
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({port: 8080});
console.log('Starting server');
wss.on('connection', function(ws) {
console.log('user is connected');
ws.send('user connected. Welcome.');
ws.on('message', function(message) {
console.log('received: %s', message);
ws.send('Response to ' + message);
});
ws.on('disconnect', function() {
console.log('user disconnected');
});
});
Happy codding!
Subscribe to:
Posts (Atom)