So HAProxy is primalery a load balancer an proxy for TCP and HTTP. But it may act as a traffic regulator. It may also be used as a protection against DDoS and service abuse, by maintening a wide variety of statistics (IP, URL, cookie) and when abuse is happening, action as denying, redirecting to other backend may undertaken ([haproxy ddos config], [haproxy ddos])
| import { useCallback, useEffect, useState } from 'react'; | |
| import { useSetRecoilState } from 'recoil'; | |
| import { useKeycloak } from '@react-keycloak/web'; | |
| import { commonNotification } from './common'; | |
| /** | |
| * Returns the auth info and some auth strategies. | |
| * | |
| */ |
| /** | |
| * Simulates a paste event. | |
| * | |
| * @param pasteOptions Set of options for a simulated paste event. | |
| * @param pasteOptions.destinationSelector Selector representing the DOM element that the paste event should be dispatched to. | |
| * @param pasteOptions.pastePayload Simulated data that is on the clipboard. | |
| * @param pasteOptions.pasteFormat The format of the simulated paste payload. Default value is 'text'. | |
| */ | |
| function paste({ destinationSelector, pastePayload, pasteType = 'text' }) { | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Element/paste_event |
| # | |
| # This is the ultimate HAProxy 2.0 "Getting Started" config | |
| # It demonstrates many of the features available which are now available | |
| # While you may not need all of these things, this can serve | |
| # as a reference for your own configurations. | |
| # | |
| # Have questions? Check out our community Slack: | |
| # https://slack.haproxy.org/ | |
| # |
| var crypto = require('crypto'); | |
| /** | |
| * Generates and returns a Freshdesk Single Sign On URL | |
| * {@link https://gist.github.com/derekseymour/26a6fe573c1274642976 Gist} | |
| * | |
| * @author Derek Seymour <derek@rocketideas.com> | |
| * @param {String} name - The name of the user logging in. | |
| * @param {String} email - A valid email address to associate with the user. |
| const puppeteer = require('puppeteer'); | |
| const cheerio = require('cheerio'); | |
| async function run() { | |
| const browser = await puppeteer.launch(); | |
| const page = await browser.newPage(); | |
| await page.goto('https://news.ycombinator.com'); | |
| let content = await page.content(); | |
| var $ = cheerio.load(content); |
| // Create a queue to push events and stub all methods | |
| window.analytics || (window.analytics = {}); | |
| window.analytics_queue || (window.analytics_queue = []); | |
| (function() { | |
| var methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off']; | |
| var factory = function(method) { | |
| return function () { | |
| var args = Array.prototype.slice.call(arguments); | |
| args.unshift(method); |
This is a working example on how to store CryptoKeys locally in your browser. We are able to save the objects, without serializing them. This means we can keep them not exportable (which might be more secure?? not sure what attack vectors this prevents).
To try out this example, first make sure you are in a browser that has support for async...await and indexedDB (latest chrome canary with chrome://flags "Enable Experimental Javascript" works). Load some page and copy and paste this code into the console. Then call encryptDataSaveKey(). This will create a private/public key pair and encrypted some random data with the private key. Then save both of them. Now reload the page, copy in the code, and run loadKeyDecryptData(). It will load the keys and encrypted data and decrypt it. You should see the same data logged both times.
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.