cFosSpeed Webserver API

cFosSpeed internal webserver API

To access the webserver in cFosSpeed use a URL beginning with:

http://localhost:1487/cfosspeed/

1487 is the default port number. You can specify a different port number in
the file c:\programdata\cfos\cfosspeed\global.ini, section [All], key
“server_port”.

Parameters are specified as in normal GET requests by appending a “&” or “?”,
then the parameter name, then “=” and lastly a UriComponentEncoded value to
the URL, e.g.,

http://localhost:1487/cfosspeed/util?f=test¶m1=val1


The following functions are available:


Get list of current connections
——————————-

http://localhost:1487/cfosspeed/util?f=current_connections

Parameters:
from= default 1
to= default 0
mode=m default 0

m == 0 individual connections
m == 1 group connections with same program name together
m == 2 group connections with same L7 protocol together
m == 3 group connections with same program name / L7 protocol pair together

instead of mode you can also specify one or more filters

con_id only return stats about one connection with this con_id
program only return stats about connections with a certain program
prot only return stats about connections with a certain L7 protocol

Return:
JSON array of connections

each connection has the following properties:
rip remote IP address
lip local IP address
rp remote port
lp local port
pr L7 protocol
tcp true if TCP, false otherwise
key unique connection id (con_id)
rx total number of bytes received
tx total number of bytes sent
rx_cps current speed in bytes/s, receive
tx_cps current speed in bytes/s, send
rx_spd current speed in 0..100 percent, receive
tx_spd current speed in 0..100 percent, send
stm connection start time as unix time stamp in seconds
rtt round-trip-time in milliseconds
pg program name (exe)
l7d L7 protocol data
c prio class
sc saved prio class (if c != sc) priority was changed manually
h host name
n number of connections if grouped, otherwise 1
mrx max receive speed in bytes/sec
mtx max send speed in bytes/sec
p current cFosSpeed port number
rxh array of rx_spd values of the last “from” to “to” seconds
txh array of tx_spd values of the last “from” to “to” seconds
a value of -1 in the array means: connection not available


Get status infos for all open ports
———————————–

http://localhost:1487/cfosspeed/util?f=stat_infos

Parameters:
d= default “text/javascript”

Return:
JSON array of status info per open port, see
https://www.cfos.de/en/skin/skin-reference.htm
for details.


Prepare usage data
——————

http://localhost:1487/cfosspeed/util?f=read_bdata

Prepare all program and protcol usage data for
evaluation for usage graph display. Also collect list
of used programs / protocols for the last 12 months.

Return:
“ok”


Recommend WiFi channels
———————–

http://localhost:1487/cfosspeed/util?f=wifi_channel_recommendation

Return:
space-separated list of WiFi channel numbers, least used first,
most used last.


Get WiFi frequence usage
———————————-

http://localhost:1487/cfosspeed/util?f=wifi_freq_usage

Return:
JSON array of entries with name, center frequency in kHz and signal strength (from 0 to 100).


Get names of all RAS / Dial-Up Networking entries
————————————————-

http://localhost:1487/cfosspeed/util?f=ras_entry_names

Return:
JSON array with names of all RAS entries


Get names of all network entries cFosSpeed is bound to
——————————————————

http://localhost:1487/cfosspeed/util?f=get_network_entries

Return:
JSON array with names of all entries with the following members:

name friendly name of the adapter
entry_name name of the entry for traffic shaping settings
section section name for traffic shaping settings
st 0 = traffic shaping disabled, 2 = traffic shaping enabled
is_wan true = dial-up connection, false = LAN connection
mac MAC address of the adapter if LAN connection
ip Router IP address if LAN connection


Set parameters of network entry
——————————-

http://localhost:1487/cfosspeed/util?f=set_network_entry

Parameters:
is_wan= default 0, n = 1 means WAN / dial-up adapter
st= default , if not empty: n = 0 disable traffic shaping
n = 2, enable traffic shaping
entry_name as returned by ‘get_network_entries’ for this adapter,
must be specified if is not empty
mac as returned by ‘get_network_entries’ for this adapter,
must be specified if is not empty
cooperative 1 = cooperative Traffic Shaping, 0 = non-cooperative
net_talk 1 = broadcast traffic statistic to other cFosSpeed in your LAN, 0 = disabled
budget 1-10, count traffic to Budget 1-10, 0 = don’t count
medium set traffic shaping medium
0=adaptive, 1 = DSL PPPoE, 2 = DSL PPPoE VC MUX, 3 = DSL PPTP, 4 = cable
5 = ISDN, 6 = DSL PPPoA LLC, 7 = IP over AAL5, 8 = bridged over AAL5,
9 = frame_count, 10 = cable mixed, 11 = 3G/4G/5G, 12 = VDSL
see output of the SPD set medium /? for a list of supported mediums
use_variance 1 = take ping variance into account, 0 = use fixed ping values

Restore default prioritization settings
—————————————

http://localhost:1487/cfosspeed/util?f=restore_defaults

Parameters:
d= type = ‘progs’, restore program priorities,
type = ‘prots’, restore L7 protocol priorities


Get directory of cFosSpeed global data
————————————–

http://localhost:1487/cfosspeed/util?f=program_data_dir

Return:
The location of the cFosSpeed program data directory


Get/set a named cFosSpeed parameter
———————————–

http://localhost:1487/cfosspeed/util?f=param

Parameters:
d=
default empty, a section name in the file global.ini
k= name of the key to get or set
v= if present, the key will be set to

Return:
The value of the key


Set the priority of a program or protocol (permanently)
——————————————————-

http://localhost:1487/cfosspeed/util?f=set_item_prio

Parameters:
d= ‘prog’ for programs, ‘prot’ for protocols
k= exe filename for programs, l7 name for protocols
v= prio of the item: ‘lowest’, ‘low’, ‘normal’, ‘high’, ‘higher’
filter= filter selection in the dialog, e.g., ‘multimedia’
desc= is a description, in case the item is created (instead of
just modified)
flush=1 if present, the modfication is written to disk immediately,
otherwise it might be delayed


Get the list of priorities
————————–

http://localhost:1487/cfosspeed/util?f=get_prio_list

Parameters:
d= ‘prog’ for programs, ‘prot’ for protocols
filter= filter selection in the dialog, e.g., ‘multimedia’
used_only=1 if present only programs used in the last 12 months are
returned

Return:
JSON array of priority entries. Each entry has the following members:

exe the exe filename of the program or the L7-protocol name
c the current priority
u the priority which was set by the user
s the priority in the default settings
f the filter of the current item
d the description


Get the list of used programs or protocols
——————————————

http://localhost:1487/cfosspeed/util?f=get_used

Parameters:
d= ‘prog’ for programs, ‘prot’ for protocols

Return:
JSON array of programs (exe filenames) or L7 protocol names


Get the settings of a budget
—————————-

http://localhost:1487/cfosspeed/util?f=get_budget

Parameters:
d= n = 1..10 to select one of the 10 budgets

Return:
A budget object with the following members:

time_used string with the time used in min:secs
volume_used volume used in bytes
hard_limit 1 if the limit is enforced, 0 if not
time_limit time limit in secs
volume_limit numeric value of the volume limit
volume_limit_unit 0=kilobytes, 1=megabytes, 2=gigabytes
reset_day 1..31, the day when the used time and volume are reset
to 0


Set the parameters of a budget
——————————

http://localhost:1487/cfosspeed/util?f=set_budget

Parameters:
d= n = 1..10 to select one of the 10 budgets
hard_limit= n = 1 enforce limit, 0 don’t
time_limit= time limit in seconds
volume_limit= numeric value of the volume limit
volume_limit_unit= 0=kilobytes, 1=megabytes, 2=gigabytes
reset_day= 1..31 day when the used values of the budget are
reset


Get historical usage data
————————-

http://localhost:1487/cfosspeed/util?f=set_graph_data

Parameters:
type= 1 = totals, 2 = budgets, 3 = protocols, 4 = programs
sel= s selects which item in the type

Return:
JSON object with the following members:

month array of the numbers of the last 12 months
year array of the years of the last 12 months
mday array of the number of days of the last 12 months
rx: array of 12 arrays with the number of received bytes for each of the
last 12 months
tx: array of 12 arrays with the number of sent bytes for each of the last
12 months


Get receive/send stats for an item type
—————————————

http://localhost:1487/cfosspeed/util?f=set_graph_data

Parameters:
type= 1 = totals, 2 = budgets, 3 = protocols, 4 = programs
range= get usage data for the last days

Return:
JSON array of objects with the following members:

n name of the item
desc description of the item
rx number of received bytes in the last days
tx number of received bytes in the last days


Activate IP blocker
——————-

http://localhost:1487/cfosspeed/util?f=ip_blocker

Parameters:
d= 1 = activate, 0 = deactivate


Send an SPD command to the driver
———————————

http://localhost:1487/cfosspeed/spd?cmd

is the command string sent to the driver.

Return:
Text output of the driver.


Get the icon of the currently running exe
—————————————–

http://localhost:1487/cfosspeed/stats/icon

Parameters:
exe= exe filename
small=1 if present, retrieve the small icon, otherwise the normal icon.

Return:
A PNG image with the icon or a default image, if an icon is not available.

Scroll to Top