
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@networked-aframe/naf-janus-adapter
Advanced tools
Network adapter for networked-aframe that uses the Janus WebRTC server as a backend.
naf-janus-adapter needs access to networked-aframe's NAF
global variable. Include it after including networked-aframe but before the networked-scene
is loaded.
naf-janus-adapter should support anything that supports recent WebRTC standards (right now, the RTPSender
-based APIs for manipulating streams and tracks). At the time of this writing, that means that many browsers (e.g. Chrome) will require the use of the WebRTC adapter shim. If you're using NPM to build your A-Frame application, you should include webrtc-adapter as a dependency of your application; if you're using the browser distribution, you should include the WebRTC adapter prior to including naf-janus-adapter, as shown in the example code below.
<html>
<head>
<script src="https://webrtc.github.io/adapter/adapter-latest.js" crossorigin="anonymous"></script>
<script src="https://aframe.io/releases/1.4.2/aframe.min.js" crossorigin="anonymous"></script>
<script src="https://unpkg.com/networked-aframe@^0.11.0/dist/networked-aframe.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/networked-aframe/naf-janus-adapter@4.2.0/dist/naf-janus-adapter.min.js"></script>
</head>
<body>
<a-scene networked-scene="
room: 1;
adapter: janus;
serverURL: wss://preprod-janus.example.com/janus;
">
</a-scene>
</body>
</html>
Compared to other adapters like easyrtc, the janus adapter has a specific API,
you need to call NAF.connection.adapter.setClientId
and
NAF.connection.adapter.setLocalMediaStream
, see the Audio example
and the Audio with Camera example.
The audio:false
on the networked-scene
is not supported by this adapter.
If you want to mute the mic, you need to use
NAF.connection.adapter.enableMicrophone(false)
A specific behavior of the janus adapter is that connect()
returns a
Promise (it's not the case with the easyrtc adapter).
The Promise returns when all peer connections to the participants are
established. So you can use this:
AFRAME.scenes[0].components["networked-scene"].connect().then(() => {
// do something
});
getMediaStream
supports a second parameter to get the video stream instead of
the default "audio" stream. To get the video stream of a participant:
const stream = await NAF.connection.adapter.getMediaStream(clientId, "video")
4.0.0 allows the application to control when occupants are subscribed to. Occupants are no longer automatically subscribed to when they join. The application is now required to call syncOccupants
and pass an array of occupantId
s that it wants to subscribe to. This list should contain all occupantsId
s that are currently desired to be subscribed to- including any that have already been subscribed to and want to continue to be so. Any occupants not on the list that are already subscribed to will be unsubscribed from.
NAF.connection.adapter.syncOccupants(arrayOfOccupantIds);
If you want to automatically subscribe to occupants on join, you may call syncOccupants
with the availableOccupants
array as the first argument once in the onConnect
function.
NAF.connection.adapter.syncOccupants(NAF.connection.adapter.availableOccupants);
or set requestedOccupants
to be the same array instance as availableOccupants
in the adapter-ready
event listener if this is more convenient for you:
scene.addEventListener('adapter-ready', ({ detail: adapter }) => {
// We don't use the syncOccupants API, set requestedOccupants to be the same array instance as availableOccupants
adapter.requestedOccupants = adapter.availableOccupants;
...
});
npm start
npm run build
npm run release
For development on the same LAN with npm start
and if you run the janus docker image locally, you can use the config
serverURL: wss://192.168.1.15:8080/janus;
(change the ip by yours of course).
FAQs
networked-aframe Janus network adapter
We found that @networked-aframe/naf-janus-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.