How to get Socket ID in Jmeter? - sockets

I refer to this tutorial
: http://seleniumparadise.blogspot.com/2015/07/jmeter-web-socket-testing.html
I am trying to test web socket but it cannot run HTTP Request.
My WebSocket :
ws://localhost:3000/socket.io/?EIO=3&transport=websocket&sid=DemHDCauiFttdm0WAAA9
How to get Socket ID in my web socket ?

I don't think you can test WebSocket protocol using HTTP Request sampler and would recommend using WebSocket Sampler plugin instead. The easiest way to install the plugin is using JMeter Plugins Manager

Related

Notification for client connection establishment in server

I am using nghttp2 C++ library (version 1.30) to implement a web server using nghttp2::asio_http2::server. In the deployment many HTTP client connects to the sever and invokes several REST API over time before diconnect. The nghttp2 C++ library provides on_connect which helps to know when the connection is established in the client application.
Is there any simialr way to execute any call back or get notification in the server when the client connects? It is required to get the notification before the REST API is invoked. For example if a client connects and invokes two REST API, the server should be notified once. If I provided handler to server.handle, thats get invoked for each REST API call.
Notification/callback in server code

is it possible to connect Openfire via http request?

suppose now I have an openfire XMPP server, 10 android tablab is connected to it and it is able to communicate to each other via openfire server.
and now there is another server from third party call Server A. Is it possible to let Server A to send some http request to openfire server to config the setting? such as create a chat room, delete a chat room and so on.
yes you can create chat rooms over HTTP Request with help of Openfire MUC Service plugin.
You can download the plugin here: http://www.igniterealtime.org/projects/openfire/plugins.jsp
The full documentation for the REST interface is here: https://www.igniterealtime.org/projects/openfire/plugins/mucservice/readme.html
e.g. to create a chat room:
Header: Authorization: Basic YWRtaW46MTIzNDU= Header: Content-Type:
application/xml
POST http://example.org:9090/plugins/mucservice/chatrooms
Payload Example 1 (required parameters):
<chatRoom>
<naturalName>global-1</naturalName>
<roomName>global</roomName>
<description>Global Chat Room</description>
</chatRoom>
If you need to create users over HTTP Request, you could use the User Service Plugin.

How can i receive the REST API request in Mule?

I have used local JIRA Server and i am using Webhook integration concept in JIRA. Here i am giving the Webhook URL is "localhost:8081/webhook" and Event is Create and Update issue. when i am create or update issue means it will be pass to "localhost:8081/webhook". The same address only i gave in mule also but its not working in my MULE. Mule didn't listen the webservice. How can i USE REST API in mule. Which flow is used for receive the JSON format REST API data. It's possible means how can i do this work.
By far the easiest way to do this in Mule now is to use the new Api Kit and write your service description in RAML.
Intro material with docs and examples at: ww.mulesoft.org/documentation/display/current/APIkit
The mule http components may be outboud e.g call your rest api or inbound where the mule server will listen for an event on a http port and url
You say mule is not listening, you should be able to quite simply setup a mule inbound http component flow .. and trigger this flow by pointing your browser at it. I think you will find mule is listening correctly, and you may have mis-configured some of your settings?

Apache can't send request to localhost:8080 (to use Mule Esb Flow)

I'm trying to use a sample web application that use Ajax to send a request to a php REST service.
I need to use Mule ESB to do this, so i fix my ajax function to send request to ESB on localhost:8080. But the browser said that i can't do this for security reason.
So, there are any way to use mule ESB with a web app (local appache server) locally ?
Trying to GET a resource from the same host but from a different port is considered cross scripting as explained here
If you want to retrieve it you can:
all the option listed at the above link
put mule behind a reverse proxy within your apache configuration
serve all the content via mule

Node.js and wss://

I'm looking to start using javascript on the server, most likely with node.js, as well as use websockets to communicate with clients. However, there doesn't seem to be a lot of information about encrypted websocket communication using TLS and the wss:// handler. In fact the only server that I've seen explicitly support wss:// is Kaazing.
This TODO is the only reference I've been able to find in the various node implementations. Am I missing something or are the websocket js servers not ready for encrypted communication yet?
Another option could be using something like lighttpd or apache to proxy to a node listener, has anyone had success there?
TLS/SSL support works for this websocket implementation in Node.js, I just tested it: https://github.com/Worlize/WebSocket-Node/issues/29
Well you have stream.setSecure() and server.setSecure().
I'm guessing you should be able to use one of those (specially the last one) to use TLS in websockets since in the end a websocket is just a normal http connection "upgraded" to websocket.
Using TLS in the normal http server object should theorically also secure the websocket, only by testing this can be confirmed.