Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cheerp test</title>
</head>
<body>
<script src="xmlHttpRequest.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cheerp test</title>
</head>
<body>
<script src="xmlHttpRequest.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cheerp test</title>
</head>
<body>
<script src="xmlHttpRequest.js"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cheerp test</title>
</head>
<body>
<script src="xmlHttpRequest.js"></script>
</body>
</html>
#include <cheerp/clientlib.h>
#include <cheerp/client.h>
using namespace client;
// webMain is the entry point for web applications written in Cheerp
void webMain()
{
//Synchronous mode
client::XMLHttpRequest* xhr=new client::XMLHttpRequest();
xhr->open("GET","/someurl",false);
xhr->send();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cheerp test</title>
</head>
<body>
<canvas id="pongcanvas"></canvas>
<script src="pong.js"></script>
</body>
// The cheerp/clientlib.h header contains declarations for the browser APIs
#include <cheerp/clientlib.h>
// webMain is the entry point for web applications written in Cheerp
void webMain()
{
client::console.log("Hello, World Wide Web!");
}
#!/bin/bash \
FILES=/root/*.proto
for f in $FILES
do
PB=$(echo $f | cut -d'/' -f3-)
protoc --plugin=/usr/local/bin/protoc-gen-go $PB --go_out=src/go
protoc $PB --cpp_out=src/cpp
protoc $PB --java_out=src/java
done
#ifndef MULTIPLER_COAPCLIENY_HPP
#define MULTIPLER_COAPCLIENY_HPP
#include "mongoose.h"
#include <iostream>
#include <string>
#include <functional>
class CoapClient {
struct mg_mgr mgr;
struct mg_connection *nc;
class CoapClient {
struct mg_mgr mgr;
struct mg_connection *nc;
std::string address{"udp://127.0.0.1:5683"};
public:
static int s_time_to_exit;
CoapClient() {
std::cout << "[Client] Using %s as CoAP server" << address << std::endl;
mg_mgr_init(&mgr, 0);