This document discusses using WebRTC in Perl to enable real-time communication between browsers. It explains that WebRTC allows peer-to-peer connections without plugins by using signaling to exchange endpoint details and ICE servers. It then provides over 350 lines of Perl code to demonstrate setting up a WebRTC connection between an "offerer" and "answerer" browser to allow sending messages over a data channel. The code connects the browsers as peers, exchanges session descriptions and ICE candidates, creates audio/video constraints, and includes a chat interface to test the connection.
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Arc & Codementor
Codementor PHP expert mentor Ben Edmunds is the co-host of PHP Town Hall and author of Building Secure PHP Apps.
Ben is also the creator of Ion Auth, a simple, lightweight authentication library for CodeIgniter.
In an interactive format, Ben talked about:
Modern PHP
Latest PHP tools
SQL Injection
Password Hashing and Authentication
Other Common Hacks
https://www.codementor.io/benedmunds
https://www.codementor.io/php-tutorial/building-modern-secure-php-applications-codementor-office-hours-ben-edmunds
Keeping it small - Getting to know the Slim PHP micro frameworkJeremy Kendall
Learn what the big deal is about PHP micro frameworks by taking a tour through an application written in Slim PHP. I'll briefly introduce you to some high level concepts, show how those concepts can be implemented in Slim, and see how powerful and elegant micro framework can be.
Una panoramica su Net::Amazon::EC2 e Net::RackSpace::Servers. Potete trovare la presentazione con le note qui: http://polettix.s3.amazonaws.com/IPW2011/nubilus-perl-1.1-note.pdf
From ReactPHP to Facebook Hack's Async implementation and many more, asynchronous programming has been a 'hot' topic lately. But how well does async programming support work in PHP and what can you actually use it for in your projects ? Let's look at some real-world use cases and how they leverage the power of async to do things you didn't know PHP could do.
Slides from the talk at http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/151672182/
Source code for the demo at https://github.com/zymsys/Slim-RedBeanPHP-KnockoutJS
Event looped, asynchronous programming is possible with PHP! Streams, promises, async IO, web sockets -- you can do it all, with React PHP. Presented by Luke Kysow.
Managing State in React Apps with RxJS by James Wright at FrontCon 2019DevClub_lv
Redux is one of the most popular technologies for the management of shared state across entire React applications, which can be complemented by Redux Observable to describe asynchronous side effects with RxJS. This approach, however, adds cognitive load when balancing the varying concepts across these three libraries. What if we could use RxJS exclusively for managing state in our React apps? This talk will demonstrate this possibility and the benefits it provides.
Building Modern and Secure PHP Applications – Codementor Office Hours with Be...Arc & Codementor
Codementor PHP expert mentor Ben Edmunds is the co-host of PHP Town Hall and author of Building Secure PHP Apps.
Ben is also the creator of Ion Auth, a simple, lightweight authentication library for CodeIgniter.
In an interactive format, Ben talked about:
Modern PHP
Latest PHP tools
SQL Injection
Password Hashing and Authentication
Other Common Hacks
https://www.codementor.io/benedmunds
https://www.codementor.io/php-tutorial/building-modern-secure-php-applications-codementor-office-hours-ben-edmunds
Keeping it small - Getting to know the Slim PHP micro frameworkJeremy Kendall
Learn what the big deal is about PHP micro frameworks by taking a tour through an application written in Slim PHP. I'll briefly introduce you to some high level concepts, show how those concepts can be implemented in Slim, and see how powerful and elegant micro framework can be.
Una panoramica su Net::Amazon::EC2 e Net::RackSpace::Servers. Potete trovare la presentazione con le note qui: http://polettix.s3.amazonaws.com/IPW2011/nubilus-perl-1.1-note.pdf
From ReactPHP to Facebook Hack's Async implementation and many more, asynchronous programming has been a 'hot' topic lately. But how well does async programming support work in PHP and what can you actually use it for in your projects ? Let's look at some real-world use cases and how they leverage the power of async to do things you didn't know PHP could do.
Slides from the talk at http://www.meetup.com/GTA-PHP-User-Group-Toronto/events/151672182/
Source code for the demo at https://github.com/zymsys/Slim-RedBeanPHP-KnockoutJS
Event looped, asynchronous programming is possible with PHP! Streams, promises, async IO, web sockets -- you can do it all, with React PHP. Presented by Luke Kysow.
Managing State in React Apps with RxJS by James Wright at FrontCon 2019DevClub_lv
Redux is one of the most popular technologies for the management of shared state across entire React applications, which can be complemented by Redux Observable to describe asynchronous side effects with RxJS. This approach, however, adds cognitive load when balancing the varying concepts across these three libraries. What if we could use RxJS exclusively for managing state in our React apps? This talk will demonstrate this possibility and the benefits it provides.
[PHPCon 2023] “Kto to pisał?!... a, to ja.”, czyli sposoby żeby znienawidzić ...Mateusz Zalewski
Czysty kod. Jakościowe oprogramowanie. Dobre praktyki. Święte Graale pracy programisty, o których każdy z nas wie, a mimo to wciąż zachowujemy się tak, jakby ich nie było. Bo przecież ten kod to tylko na chwilę. A tego to w ogóle nie będziemy używać. A tę klasę się zrefaktoruje później. Wszyscy od czasu do czasu zaciągamy dług u samych z siebie z przyszłości - dług, którego potem (nie bez powodu) bardzo nie chcemy spłacać.
Zagłębmy się więc w ten fascynujący świat słabego oprogramowania. Przejdźmy przez las nieużytych wzorców projektowych, przebrnijmy przez bagna zagnieżdżonych pętli. Wejdźmy na kolejny ośmiotysięcznik, a może z jego szczytu uda nam się dojrzeć zatokę pięknego kodu - w której, miejmy nadzieję, tym razem pozostaniemy na dłużej.
This talk will explore inference from the perspective of protocols and generics and is based off a series of blog posts I've written(foxinswift.com) on the topic. In the first part of my talk casting number types through inference. I'll then show you struct serialization example demonstrating inferring a type through a mapping function. My last example will take you through inferring an associatedtype on a barebones promise implementation and we'll use it to in the context of making a network request. To finish things off I'll briefly speak on what's new in swift generics and some limitations of those features.
PHP 8.1 brings Enums, one of the most requested features in PHP.
Enums, or Enumerations, allow creating strict and type-safe structures for fixed values. An Enum structure can hold a number of values that can also be backed with integer or string values.
In this comprehensive session, we will discover what Enums are, why they are useful, how to apply them on our applications, and things to watch out for when using Enums.
jSession #4 - Maciej Puchalski - Zaawansowany retrofitjSession
Biblioteka Retrofit ułatwia życie programisty. Służy ona do czegoś co w dzisiejszych czasach jest niezbędne, czyli połączenia z internetem aby pozyskać tamtejsze zasoby.
Wszystko to jest sprowadzane do niezbędnego minimum pisanego kodu.
W tej prezentacji opisane zostaną te bardziej zaawansowane możliwości tej biblioteki, razem z drobnym wprowadzeniem czym ona właściwie jest i co potrafi.
Async/await is a new language feature that will ship with Swift 5.5 this year. There’s no doubt it will have a significant impact on how we write asynchronous code.
In this talk, we’re going to look at some use cases for async/await, how we can call existing Swift APIs using this new feature, and why your decision to write your SDK in Objective-C might turn out to have been a very clever move.
We’ll also have a look at the refactoring support Apple is adding to Xcode and how it will help you migrate your existing code base.
Server side data sync for mobile apps with silexMichele Orselli
oday mobile apps are everywhere. These apps cannot count on a reliable and constant internet connection: working in offline mode is becoming a common pattern. This is quite easy for read-only apps but it becomes rapidly tricky for apps that create data in offline mode. This talk is a case study about a possible architecture for enabling data synchronization in these situations. Some of the topics touched will be:
- id generation
- hierarchical data
- managing differente data types
- sync algorithm
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Generating a custom Ruby SDK for your web service or Rails API using Smithyg2nightmarescribd
Have you ever wanted a Ruby client API to communicate with your web service? Smithy is a protocol-agnostic language for defining services and SDKs. Smithy Ruby is an implementation of Smithy that generates a Ruby SDK using a Smithy model. In this talk, we will explore Smithy and Smithy Ruby to learn how to generate custom feature-rich SDKs that can communicate with any web service, such as a Rails JSON API.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
6.
How
Use signaling to exchange endpoint details
Signaling is the backend
Directly connect, if possible
Relay server used if nothing else works
7. #!/OPT/PERL
FUNCTION APPENDDIV(DATA)
VAR DIV
USE
USE
MOJOLICIOUS ::LITE;
JSON;
{
= DOCUMENT.CREA TEELEMENT('DIV');
= DATA;
FUNCTION RETURNSDP()
{
APPENDDIV("ANSWERER: SEND SDP");
DIV.INNER HTML
SOCKET.SEND({
SENDER: 'ANSWERER',
VAR CHATOUTPUT
'/' => SUB {
MY $SELF = SHIFT;
= DOCUMENT.GE TELEME NTBYID('CHA T-OUTPUT');
SDP: ANSWERER.LOCALDES CRIP TION
CHATOUTP UT.INS ERTBEFORE(DIV, CHATOUTPUT.FIRS TCHILD);
GET
});
}
DIV.TABINDE X
$SELF->RENDER("INDE X");
= 0;
DIV.FOCUS();
};
IF (ISFIREFOX)
}
{
ANSWERER.SETRE MOTE D ESCRIP TION(NEW MOZRTCS ESS ION DE SCRIP TION(OFFER SDP), FUNCTION()
ANSWERER.CREATE ANSWE R(FUNCTION
MY
'/WSCHANNEL/:TYPE' => SUB {
$SELF = SHIFT;
MY
$TYPE = $SELF->PARAM("TYPE ");
VAR ICESERVERS
WEBSOCKET
ICESERVERS:
={
$SELF->APP->LOG->DEBUG("W EBSOCKET
OPENED:
}, ONERROR,
});
$ID = MOJO::IOLOOP->RECURRING(4 => SUB {
("OFFERER" EQ $TYPE) {
IF (- F "/TMP/SDP.ANSWERER") {
$SELF->APP->LOG->DEBUG("SENDING SDP: TO OFFERER FROM ANSWERER");
MY $TXT = MOJO::UTIL::SLURP("/TMP/SDP.ANSWERE R");
MY $REF = JSON::FROM_JSON($TX T);
$SELF->SEND({JSON => $REF});
UNLINK ("/TMP/SDP.ANSWERER");
MOJO::UTIL::SPURT(SCA LAR LOCALTIME(TIME), "/TMP/SDP.OFFERER.SENT");
}
OPTIONAL:
={
[{DTLSSRTPK EYA GREEMENT:
{RTPDA TAC HA NNE LS:
TRUE
}]
={
[],
{
OFFERTORECE IVE AUDIO:
OFFERTORECE IVE V IDEO:
VAR MEDIACONS TRA INTS
VAR CHATINPUT
IF (E.KEYCODE
APPENDDIV(THIS.VALUE);
FUNCTION SETCHANNEL EV ENTS ( CHANNEL, CHANNELNA MEF OR CONSOLEOUTP UT)
CHANNEL.ONERROR
FALSE
= ONERROR;
OFFERER
MOZRTCPE ERC ONNECTION(ICES ERV ERS, OPTIONA L RTPD A TA CHANNELS );
= NEW
WEBKITRTCPEE RC ONNECTION(ICESE RV ERS, OPTIONAL R TPD A TA CHA NNELS );
= FUNCTION () {
CONSOLE.LOG("CHANNEL: ONOPEN");
}
DOCUMENT.GETELE ME NTB Y ID('CHA T- INP UT').DIS ABLED
ELSE
{
OFFERER
= FALSE;
};
}
}
= OFFERER.CREATED A TA CHANNEL('RTCD A TA CHANNEL', {
RELIABLE : TRUE
{
VAR URL;
IF
});
("OFFERER" == TYPE) {
URL = "<%= URL_FOR('/WSCHANNEL/OFFERE R')->TO_AB S->SCHEME('WS') %>";
}
CONNECTION
FROM OFFERER");
= OFFERERDATAC HANNEL;
ELSE
CONSOLE.LOG("CONSOLE : OFFERER");
{
URL =
"<%= URL_FOR('/WSCHANNEL/ANSWERER')->TO_ ABS->SCHE ME('WS') %>";
}
SETCHANNEL EVE NTS (OFFERER DA TAC HANNEL, 'OFFERER');
CONSOLE.LOG("CONNECTING:
SOCKET
= FUNCTION (EVENT) {
CONSOLE.LOG("ONICECANDIDA TE : OFFERER");
IF (EVENT.CANDIDA TE ) SENDCANDIDA TE (EVE NT.CANDIDA TE );
IF (!EVENT.CANDIDA TE ) RETURNSDP();
FROM OFFERER");
" + URL);
= NEW W EBSOCKET(URL);
= FUNCTION () {
" + URL);
SOCKET.ONOPEN
APPENDDIV("CONNECTED:
};
SOCKET.ONMESSA GE
= FUNCTION (E) {
= JSON.PARSE(E.DATA);
" + DATA.SENDER);
{
== 'OFFERER') {
APPENDDIV("RECV: SDP : OFFERER");
CREATEANSWER(DA TA. SDP);
};
VAR DATA
CONSOLE.LOG("ONMESSA GE :
FUNCTION SENDCANDIDA TE ()
{
IF (DATA.SDP)
APPENDDIV("OFFERER: SEND CANDIDA TE ");
IF (DATA.SENDER
SOCKET.SEND({
SENDER: 'OFFERER',
}
CANDIDATE : EVENT.CANDIDA TE
}
}
});
ELSE
});
}
$SELF->ON(MESSAGE => SUB {
MY ($SELF, $MSG) = @_;
FUNCTION RETURNSDP()
{
APPENDDIV("RECV: SDP : ANSWERER");
IF (ISFIREFOX)
{
APPENDDIV("OFFERER: SEND SDP");
SOCKET.SEND({
SENDER: 'OFFERER',
SDP: OFFERER.LOCALDE SCRIP TION
});
$TYPE");
($$RET{SENDER} && "OFFERER" EQ $$RET{SENDER} && $$RET{SDP}) {
MOJO::UTIL::SPURT($MSG, "/TMP/SDP.OFFERER");
ELSE
OFFERER.CREATE OFFER(FUNCTION
}
(SESSIONDES CRIP TION) {
OFFERER.SETLOCA LD ESCRIP TION(SE SS ION DES CRIP TION);
}, ONERROR, MEDIA CONS TRA INTS);
FUNCTION ONERROR( ERR)
{
CONSOLE.LOG(ERR);
}
FUNCTION CREATEANSWER(OFFER SDP)
{
{
ANSWERER = NEW MOZRTCP EER CONNE CTION( ICE SERVE RS ,
IF (ISFIREFOX)
OPTIONAL R TP DA TAC HANNE LS );
}
ELSE
{
= NEW WEBKITRTCP EER CONNE CTION(ICE SERVE RS,
ANSWERERDATA CHA NNE L
OPTIONAL RTP DA TAC HANNELS );
IF
= ANSWERER.CREA TED A TA CHANNEL('RTCD A TA CHANNEL', {
RELIABLE : TRUE
});
SETCHANNEL EVE NTS (ANSWERE RD A TA CHANNEL, 'ANSWERER');
CONNECTION
$CODE.");
= ANSWERERDATA CHANNEL;
CONSOLE.LOG("CONSOLE : ANSWER");
ANSWERER.ONICECANDIDA TE
= FUNCTION (EVENT) {
CONSOLE.LOG("ONICECANDIDA TE : ANSWERER");
};
IF (EVENT.CANDIDA TE ) SENDCANDIDA TE ();
IF
(!EVENT.CANDIDA TE )
RETURNSDP();
APP->START;
};
__DATA__
FUNCTION SENDCANDIDA TE ()
}
SOCKET.PUSH
SOCKET.SEND
SOCKET.SEND({
});
= SOCKET.SEND;
= FUNCTION (DATA ) {
" + DATA .SENDER);
CONSOLE.LOG("SEND:
SENDER: 'ANSWERER',
CANDIDATE : EVENT.CANDIDA TE
}
("ANSWERER" === DATA.SENDER && DATA.CANDIDA TE) {
APPENDDIV("RECV: CANDIDA TE : ANSWERER");
IF (ISFIREFOX) {
OFFERER.ADDICECANDIDA TE (NEW MOZRTCICECA NDIDA TE ({
SDPMLINEINDE X: DATA .CANDIDA TE .SDP ML INEINDE X,
CANDIDATE: DATA.CANDIDA TE .CANDIDA TE
}));
}
ELSE {
OFFERER.ADDICECANDIDA TE (NEW RTCICECA NDIDA TE ({
SDPMLINEINDE X: DATA .CANDIDA TE .SDP ML INEINDE X,
CANDIDATE: DATA.CANDIDA TE .CANDIDA TE
}));
}
};
{
APPENDDIV("ANSWERER: SEND CANDIDA TE");
@@ INDEX.HTML.EP
("OFFERER" === DATA.SENDER && DATA.CANDIDA TE) {
APPENDDIV("RECV: CANDIDA TE : OFFERER");
IF (ISFIREFOX) {
ANSWERER.ADDICECANDIDA TE (NEW MOZRTCICE CANDIDA TE ({
SDPMLINEINDE X: DATA .CANDIDA TE .SDP ML INEINDE X,
CANDIDATE: DATA.CANDIDA TE .CANDIDA TE
}));
}
ELSE {
ANSWERER.ADDICECANDIDA TE (NEW RTCICECANDIDA TE ({
SDPMLINEINDE X: DATA .CANDIDA TE .SDP ML INEINDE X,
CANDIDATE: DATA.CANDIDA TE .CANDIDA TE
}));
}
}
ANSWERER
}
});
CLOSED WITH STATUS
RTCSES S IOND ESCRIP TION(DA TA.SDP));
}
}
}
($$RET{SENDER} && $$RET{CANDIDA TE}) {
FOREACH MY $SUFFIX (QW (001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 END)) {
IF ("END" EQ $SUFFIX) {
$SELF->APP->LOG->DEBUG("W E ARE OUT OF CANDIDA TE SUFFIXES.");
LAST;
}
MY $F = "/TMP/CANDIDA TE .$$RE T{SENDER}.$SUFFIX";
IF (-F $F) {
NEXT;
}
MOJO::UTIL::SPURT($MS G, $F);
LAST;
}
{
OFFERER.SETREMOTE DE SCRIP TION(NEW
}
IF
($$RET{SENDER} && "ANSWERER" EQ $$RET{SENDER} && $$RET{SDP}) {
MOJO::UTIL::SPURT($MSG, "/TMP/SDP.ANSWERER");
}
{
OFFERER.SETREMOTE DE SCRIP TION(NEW MOZRTCSE SS IOND ES CRIP TION(DA TA.SDP));
}
}
}
<SCRIPT>
VAR ISFIREFOX = !!NAVIGATOR.MOZGE T USER ME DIA;
VAR CONNECTION;
+ EVENT.DATA);
SOCKET.PUSH(JSON.S TRINGIFY (DA TA));
};
}
</SCRIPT>
Code – 350 lines!!
= '';
THIS.FOCUS();
};
CHANNEL.ONOPEN
OFFERERDATA CHANNEL
$SELF->ON(FINISH => SUB {
MY ($SELF, $CODE, $REASON) = @_;
$SELF->APP->LOG->DEBUG("W EBSOCKET
MOJO::IOLOOP->REMOVE($ID);
UNLINK ("/TMP/SDP.$TYPE ");
});
A MESSAGE :'
</SCRIPT>
{
= NEW
OFFERER.ONICECANDIDA TE
IF
THIS.VALUE
+ 'RECEIVED
{
IF (ISFIREFOX)
}
IF
= FUNCTION (EVENT) {
CONSOLE.LOG("CHANNEL: ONMESSAGE ");
APPENDDIV(CHANNEL NAMEF OR CONSOLEOUTP UT
};
}
IF
CONSOLE.LOG(CONNECTION);
CONNECTION.SEND(THIS.VALUE);
CHANNEL.ONMESSAGE
VAR OFFERER, ANSWERER, ANSWERERDA TA CHA NNE L, OFFERERDA TA CHA NNEL;
ELSE
TYPE:
{
}
};
ANSWERER");
= DOCUMENT.GE TELE MENTB YID('CHA T-INPUT');
= FUNCTION(E) {
!== 13 || !THIS.VALUE) RETURN;
CHATINPUT.ONKE YP RES S
}
FALSE,
FUNCTION CONNECTS IGNALER( TYP E )
(- F "/TMP/SDP.OFFERER.SENT") {
FOREACH MY $F (GLOB("/TMP/CANDIDA TE .OFFERE R.*")) {
$SELF->APP->LOG->DEBUG("SENDING $F: TO ANSWERER
MY $TXT = MOJO::UTIL::SLURP($F);
MY $REF = JSON::FROM_JSON($ TXT);
$SELF->SEND({JSON => $REF});
UNLINK($F);
}
UNLINK ("/TMP/SDP.OFFE RER.SE NT");
{
MANDATORY :
}
$SELF->APP->LOG->DEBUG("MSG: $MSG:
MY $RET = JSON::FROM_JSON($MS G);
FUNCTION()
MEDIACONS TRA INTS );
}
OPTIONAL:
FOREACH MY
{
(- F "/TMP/SDP.OFFERER") {
MY $TXT = MOJO::UTIL::SLURP("/TMP/SDP.OFFERER");
MY $REF = JSON::FROM_JSON($TX T);
$SELF->APP->LOG->DEBUG("SENDING SDP: TO ANSWERER
$SELF->SEND({JSON => $REF});
UNLINK ("/TMP/SDP.OFFE RER ");
RTCS ESS ION DES CRIP TION(OFFER SDP),
(SESSIONDESCRIP TION) {
ANSWERER.SETLOCA LDE SCRIP TION(SE SS ION DES CRIP TION);
}, ONERROR,
}, ONERROR);
FUNCTION CREATEOFFE R()
$F (GLOB("/TMP/CANDIDA TE.ANSWERE R.*")) {
$SELF->APP->LOG->DEBUG("SENDING $F: TO OFFERER FROM
MY $TXT = MOJO::UTIL::SLURP($F);
MY $REF = JSON::FROM_JSON($TX T);
$SELF->SEND({JSON => $REF});
UNLINK ($F);
ANSWERER.CREATE ANSWE R(FUNCTION
TRUE},
};
IF
IF
{
ANSWERER.SETRE MOTE D ESCRIP TION(NEW
VAR OPTIONA L RTPD A TA CHANNELS
IF
MEDIACONS TRA INTS );
}
ELSE
$TYPE");
# INCREASE INACTIV ITY TIMEOUT FOR CONNECTION A BIT
MOJO::IOLOOP->STREAM($SELF->TX->CONNE CTION)->TIME OUT(300);
MY
(SESSIONDESCRIP TION) {
ANSWERER.SETLOCA LDE SCRIP TION(SE SS ION DES CRIP TION);
[{
URL: 'STUN:23.21.150.121'
}]
};
{
HAS WORKED IN CHROME.<BR />
CREATE OFFER SHOULD BE CLICKED BY THE "OFFERER".<BR />
<BUTTON ID="CONNECT-OFFE RER ">CONNECT AS OFFERER</BUTTON>
<BUTTON ID="CONNECT-ANSWERE R">CONNECT AS ANSWERER</BUTTON><BR />
<BUTTON ID="CREATE-OFFER">C REA TE OFFER</BUTTON>
<INPUT TYPE="TE XT" ID="CHAT-INPUT" STYLE="FONT-S IZE: 1.2EM;" PLACEHOLDER="CHA T
<DIV ID="CHAT-OUTPUT"></DIV>
<SCRIPT>
DOCUMENT.GE TE LE MENTB YID('CONNE CT-OFFERE R').ONCLICK = FUNCTION () {
THIS.DISAB LED = TRUE;
CONNECTS IGNALE R("OFFERE R");
};
DOCUMENT.GE TE LE MENTB YID('CONNE CT-ANSWE RER').ONCLICK = FUNCTION () {
THIS.DISAB LED = TRUE;
CONNECTS IGNALE R("ANSWE RER ");
};
DOCUMENT.GE TE LE MENTB YID('CREA TE-OFFE R').ONCLICK = FUNCTION () {
CREATEOFFER();
};
MESSAGE " DISABLED>
9.
$ perl datachannel.pl daemon
Luanch two instances of chrome; perhaps
stable and canary
Click answerer in one window; offerer in the
other; then click Create Offer in offerer window
Chat session should initiate
Run me