Ocyss/srs-auth / .agents/skills/srs-develop
srs-develop
VerifiedDevelop, modify, debug, review, maintain, and explain the SRS and Oryx codebases and the SRS Docker image toolchain. Use for planned changes to the next-generation SRS Go proxy, SRS browser player, ossrs/dev-docker images, or Oryx Go backend, React dashboard, integrated runtime, packaging, installers, releases, and tests; bug maintenance; issue and pull-request triage; pull-request review; and Learn Code questions. The C++ SRS server is in maintenance mode, and planned Go origin and edge development is not yet supported. NOT for end-user support, usage questions, or configuration help — use srs-support for those.
scripts/browser-page-url-test.js
View on GitHub// Copyright (c) 2013-2026 The SRS Authors
//
// SPDX-License-Identifier: MIT
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const vm = require('node:vm');
const projectRoot = path.resolve(__dirname, '../../..');
const playerJs = path.join(projectRoot, 'trunk/research/players/js');
const utilitySource = fs.readFileSync(path.join(playerJs, 'winlin.utility.js'), 'utf8');
const pageSource = fs.readFileSync(path.join(playerJs, 'srs.page.js'), 'utf8');
function buildDefaultFlvUrl(rawUrl) {
const pageUrl = new URL(rawUrl);
const context = {
window: {
location: {
host: pageUrl.host,
hostname: pageUrl.hostname,
port: pageUrl.port,
pathname: pageUrl.pathname,
search: pageUrl.search,
hash: pageUrl.hash,
protocol: pageUrl.protocol,
},
},
console,
};
vm.createContext(context);
vm.runInContext(utilitySource, context);
vm.runInContext(pageSource, context);
return context.build_default_flv_url();
}
const cases = [
{
name: 'keeps the direct SRS HTTP server port',
page: 'http://live.example.com:8080/players/srs_player.html',
expected: 'http://live.example.com:8080/live/livestream.flv',
},
{
name: 'uses the public HTTP origin',
page: 'http://live.example.com/players/srs_player.html?stream=tv.flv',
expected: 'http://live.example.com/live/tv.flv',
},
{
name: 'uses the public HTTPS origin',
page: 'https://live.example.com/players/srs_player.html?stream=tv.flv',
expected: 'https://live.example.com/live/tv.flv',
},
{
name: 'uses a custom reverse-proxy port',
page: 'https://live.example.com:8443/players/srs_player.html?stream=tv.flv',
expected: 'https://live.example.com:8443/live/tv.flv',
},
{
name: 'uses the default port when schema overrides the page protocol',
page: 'http://live.example.com:8080/players/srs_player.html?schema=https&stream=tv.flv',
expected: 'https://live.example.com/live/tv.flv',
},
{
name: 'preserves explicit target overrides',
page: 'http://live.example.com/players/srs_player.html?schema=https&server=media.example.com&port=9443&vhost=tenant.example.com&app=show&stream=main.flv',
expected: 'https://media.example.com:9443/show/main.flv?vhost=tenant.example.com',
},
];
for (const testCase of cases) {
assert.equal(buildDefaultFlvUrl(testCase.page), testCase.expected, testCase.name);
console.log(`PASS: ${testCase.name}`);
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |