Admin API via Websockets

Hi,

I am trying to access the Admin API using WebSockets, but I am not receiving events after successfully connecting.

In the documentation, it is mentioned:

If you want to expose the Admin API via WebSockets as well, you need to specify a different server instance, as you cannot mix Janus API and Admin API messaging.

What does this mean? Could my misunderstanding of this be the reason I am not receiving events from Janus, I even have created sessions and handles but there is no data at all ?

Please assist.

It means you need to configure this section:

As such, the Admin API will use different ports than the one the Janus API uses. The “server” part can be confusing, it refers to the WebSocket server instance, not the Janus server instance.

ok noted but But i had already done so here are my configs

admin: {
	admin_ws = true					# Whether to enable the Admin API WebSockets API
	admin_ws_port = 7088				# Admin API WebSockets server port, if enabled
	#admin_ws_interface = "eth0"		# Whether we should bind this server to a specific interface only
	#admin_ws_ip = "192.168.0.1"		# Whether we should bind this server to a specific IP address only
	#admin_ws_unix = "/run/aws.sock"	# Use WebSocket server over UNIX socket instead of TCP
	admin_wss = false					# Whether to enable the Admin API secure WebSockets
	#admin_wss_port = 7989				# Admin API WebSockets server secure port, if enabled
	#admin_wss_interface = "eth0"		# Whether we should bind this server to a specific interface only
	#admin_wss_ip = "192.168.0.1"		# Whether we should bind this server to a specific IP address only
	#admin_wss_unix = "/run/awss.sock"	# Use WebSocket server over UNIX socket instead of TCP
	#admin_ws_acl = "127.,192.168.0."	# Only allow requests coming from this comma separated list of addresses
	#admin_ws_acl_forwarded = true		# Whether we should check the X-Forwarded-For header too for the ACL
										# (default=false, since without a proxy in the middle this could be abused)
}

ws://ipAddress:7088/admin

You also need to use a different subprotocol: janus-admin-protocol.
I see it’s not explained in the documentation so I should probably update that.

1 Like