How to configure and start diameter client and server for diameter credit control application using freediameter - diameter-protocol

Till now I have installed and run freediameter in linux centOS 5.8. CER and CEA messages are exchanged between client and server successfully.
I am looking to embedded diameter credit control application in freediameter client and server. Client should send CCR and server should respond with CCA.
I have gone through freediameter DCCA extensions, but not able to know how to use this extensions to send and receive CCR and CCA. I googled a lot but doesn't get any help.
So all I want is to configure freediameter client and server with DCCA.
Any help will be highly appreciated.
Thanks in advance.

Freediameter provides test_app extension. we can do CCR and CCA using test_app extension.
compile freediameter and test_app extension.
cmake -DFLEX_EXECUTABLE:FILEPATH=/usr/local/bin/flex
-DGNUTLS_LIBRARY:FILEPATH=/usr/local/lib/libgnutls.so
-DGNUTLS_INCLUDE_DIR:PATH=/usr/local/include/
-DDISABLE_SCTP:BOOL=ON
-DBUILD_TEST_APP:BOOL=ON ../
make; make install
You can find test_app extension configuration file under ./doc . Change it as per requirement.
Just need to Load the test_app extension with conf file.
start freeDiameter server and client.
Raise signal 10 to client application to send CCR. (kill -s 10 PID)
That's it.

Related

How can I get an Electron and Socket.io app to run in a thin client architecture?

I created an Electron for a tiny company that connects to a Socket.io server. This app obtains the username of the logged in user and the MAC address and sends this info to the server for processing. All of this is working fine with regular desktops. Now, another company wants the same app, but they have a thin client architecture. Is there a way to get the app to run in this kind of architecture?
I am having a hart time figuring it out. I have never dealt with thin clients.
1) In the thin client architecture, would I have my socket.io server code and the app in the same server then? If they are in the same server, how could I get the app to connect to the socket.io server? They are in the same machine, so I am confused.
2) One problem is the app can't obtain the MAC of the thin client because once executed from the thin client it will end up getting the MAC of the server. Is there a way to obtain the MAC of the thin client using Node.js? Is there another way of using Node to recognize some sort of id for the thin client?
I would like the thin client to log in to the server, execute my app automatically, connect to the socket.io server, and send to it the username of the logged in user and the MAC address of the thin client. Is this possible? Do you have any suggestions on how to accomplish this?
You have to use the serverside code of the library for your server. E.g. node express.
Then you have to use the client side code of the library in a client side application. E.g. electron
Electron is a combination of node and chromium and you have to install the final build on the clients machine(s).
Of course, you can do all the things you ask about. Just read the socket.io docs. Its very easy, you can do it by specifying the host IP and listening/emitting events.

Port accessible only using wget localhost

I have a server running centos 7 using cpanel and whm with csf. I am trying to run a nodejs express application on it that listens on port 3000. In order to do so, I added the line tcp|in|d=3000|s=0.0.0.0 to csf.allow.
When I run the code and use wget localhost:3000, I get the html files as expected, but if I try to connect from a browser the server just doesn't get the request. Am I doingsomehting wrong?
I am new to Linux and server management, so sorry in advance if I didn't give enough information. I'll be happy to provide more if needed.
If anyone stumbles upon this from Google, the problem was that my server provider was blocking uncommon ports. I mailed them and after two minutes the problem was solved.

How to create web based terminal using xterm.js to ssh into a system on local network

I came across this awesome library xterm.js which is also the base for Visual Studio Code's terminal. I have a very general question.
I want to access a machine(ssh into a machine ) on a local network through a web based terminal(which is out of network, may be on a aws server). I was able to do this in a local network successfully but I could not reach to a conclusion to do it from Internet-->local network .
As an example - An aws server running the application on ip 54.123.11.98 which has a GUI with a button to open terminal. I want to open terminal of a local machine which is in a local network somewhere behind some public ip on local ip 192.168.1.7.
Can the above example be achieved using some sort of solutions where i can use xterm.js so that I don't have to go for building a web based terminal? What are the major security concerns I should keep in mind while exposing the terminals this way ?
I was thinking in line with using a fixed intermediate server between AWS and local network ip and use some sort of reverse ssh tunnel process to do this but I am not sure if this is the right way or could there be a more simple/better way to achieve this.
I know digital ocean, google cloud , they all do this but they have to connect to a computer which has public ip while I have a machine in a local network. I don't really want to configure router to do any kind of setup .
After a bit of research here is working code.
Libraries:
1) https://socket.io/
This library is used for transmit package from client to server.
2) https://github.com/staltz/xstream
This library is used for terminal view.
3) https://github.com/mscdex/ssh2
This is the main library which is used for establishing a connection with your remote server.
Step 1: Install Library 3 into your project folder
Step 2: Start from node side create a server.js file for open socket
Step 3:
Connection client socket to node server (both are in local machine)
The tricky logic is how to use socket and ssh2.
On emission of socket you need to trigger an SSH command using the ssh2 library. On response of the ssh2 library (from server) you need to transmit the socket package to the client. That's it.
Click here to find an example.
That example will have these files & folders:
Type Name
------------
FILE server.js
FILE package.json
FOLDER src
FOLDER xtream
First you need to configure your server IP, user and password or cert file on server.js and just run node server.js.
P.S.: Don't forget to run npm install
Let me know if you have any questions!
After some research later I came across this service : https://tmate.io/ which does the job perfectly. Though if you need a web-based terminal of tmate you have to use their ssh servers as a reverse proxy which ideally I was not comfortable with. However, they provide tmate-server which can be used to host your own reverse proxy server but lacks web UI. But to build a system where you have to access a client behind NAT over ssh on web, below are the steps.
Install and configure tmate-server on some cloud machine.
Install tmate on the client side and configure to connect to a cloud machine.
Create a nodejs application using xterm.js(easy because of WebSocket based communication) which connects to your tmate-server and pass commands to the respective client. (Beware of security issues of exposing this application, since you will be passing Linux commands ).
Depending on your use case you might need a small wrapper around tmate client on client-side to start/stop it automatically or via some UI/manual action.
Note: I wrote a small wrapper on client-side as well to start/stop and pass on the required information to an API server (written in nodejs) which then pass on the information to another API which connects the browser to the respective client session. Since we had written this application it included authentication as well as command restrictions of what can be run on terminal. You can customize it a lot.

Tomcat HawtIO JMX over Jolokia authorization

this is my situation:
1) I have an web application, that is running on Tomcat, inside my war I have bundled Jolokia, so now if I do something:port/jolokia I get JSON back and all works well.
2) I downloaded executable jar from howt.io and I start it from cmd (on windows) and it gets running on some defined port so I get nice web page from which I connect to my server and read JSON from Jolokia, I can see some mbeans from JMX and it's all good!
3)Now here comes the problem, I have spring-security so I configure that /jolokia/* is protected with some role, ADMIN for example, now how can I connect from Howtio to my server ? I guess I should somehow provide user/pass and get session token back or something, I have no idea where to go from here so I would appreciate very much your help!
I came up with the solution to deploy Howtio as war to my server, and then I enable authentication hawtio.authenticationEnabled=true and set tomcat users, all works well but I would really like to just have jolokia there because I have many instances of my application (on more than 50 servers), so I would like to use Howtio just as a client that will read JSON, but I need some way of securing all that!
So please if someone have an idea or can tell me how to do this ? Thanks a lot!
Connecting to remote jolokia instances is done via the 'Connect' tab. You can save connections in there to your tomcat instances, including providing a username and password, for example:
Note: this page may have been updated a bit since this screenshot.

Node.js -Couchbase - Warning: We are having troubles communicating to the indexer process. The information might be stale

I'm using Couchbase Version 4.1.0-5005 Enterprise Edition (build-5005) and trying to run bikeShop sample but it's not showing the index.
gives me this error
We are having troubles communicating to the indexer process. The information might be stale
i opened all ports (for test) as told in this tutorial but it's get the same error
My OS is win 7
what should i do? thanks.
The reason could be that ports are not opened on the server or on any of the cluster servers.
Try accessing
http://SERVER_ADDRESS:9102/getIndexStatus with basic auth and the server should return a error message.
Try opening ports 9100, 9101, 9102 and 9999 and then retry with the same url and you will get a success message with list of indexes at couchbase server.
Do you have a single node cluster?
Did you checked all of the services (Data,Index,Query) in your node?
Thanks,
Roi
For those are working on CB v5.1, try accessing "curl -v -u [user]:[pwd] http://hostname:8091/indexStatus"

Resources