A session is alive until you close it or the connection is closed. The max time duration of a session is 15 min.
Use Lightpanda with Puppeteer.
import puppeteer from "puppeteer";
const browser = await puppeteer.connect({
browserWSEndpoint: "wss://cloud.lightpanda.io/ws?token=TOKEN",
});
const page = await browser.newPage();
Use Lightpanda with Playwright.
import playwright from "playwright";
const browser = await playwright.chromium.connectOverCDP(
"wss://cloud.lightpanda.io/ws?token=TOKEN",
);
const context = await browser.newContext();
const page = await context.newPage();
Use Lightpanda with Chromedp.
package main
import (
"context"
"flag"
"log"
"github.com/chromedp/chromedp"
)
func main() {
ctx, cancel = chromedp.NewRemoteAllocator(ctx,
"wss://cloud.lightpanda.io/ws?token=TOKEN", chromedp.NoModifyURL,
)
defer cancel()
ctx, cancel := chromedp.NewContext(allocatorContext)
defer cancel()
var title string
if err := chromedp.Run(ctx,
chromedp.Navigate("https://lightpanda.io"),
chromedp.Title(&title),
); err != nil {
log.Fatalf("Failed getting title of lightpanda.io: %v", err)
}
log.Println("Got title of:", title)
}
By default, Lightpanda's managed cloud serves Google Chrome browsers.
But you can select
Lightpanda browser
using browser=lightpanda
option.
Example of using a Lightpanda browser instance.
wss://cloud.lightpanda.io/ws?browser=lightpanda&token=TOKEN
You can use proxies with your browser with proxy
query string parameter.
By default, the proxy used is datacenter
.
datacenter
proxy is a pool of shared datacenter IPs.
datacenter
accepts an optional country
query string
parameter, a two letter country code.
Example to use a german IP.
wss://cloud.lightpanda.io/ws?proxy=datacenter&country=de&token=TOKEN
We can configure additional proxies for your use case. Please contact us by email to do so.