Registry / communication / hyco-https

hyco-https

JSON →
library1.4.5jsnpmunverified

Version 1.4.5 of the hyco-https package for Azure Relay Hybrid Connections extends Node's built-in 'https' module to accept HTTPS requests via Azure Relay public endpoints. It re-exports all core https exports and adds server-side hybrid connection integration, allowing applications residing anywhere to receive HTTPS requests. The server behavior is completely overridden (cannot coexist with local https listening). Client functionality is unchanged. For frameworks like Express, explicit 'http' and 'hyco-https' requires are needed before loading the framework. Helper methods like createRelayListenUri and createRelayHttpsUri simplify URI creation with embedded tokens. Release cadence is infrequent (last update 2020). Differentiator: seamlessly replaces Node's https for hybrid cloud connectivity.

npm install hyco-https
INSTALL
IMPORT
SIG · HYCO-HTTPS
H
hyco-https
communicationjavascriptv1.4.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const hycoHttps = require('hyco-https');
import hycoHttps from 'hyco-https';
hyco-https is a CommonJS module; ESM import syntax is not supported. Use require.
createServer
const https = require('hyco-https'); const server = https.createServer((req, res) => { ... });
const { createServer } = require('hyco-https');
createServer is a method on the default export object, not a named export.
createRelayListenUri
const https = require('hyco-https'); const uri = https.createRelayListenUri(namespace, path);
const { createRelayListenUri } = require('hyco-https');
createRelayListenUri is a static method on the default export object.
ServerResponse
const https = require('hyco-https'); const ServerResponse = https.ServerResponse;
const { ServerResponse } = require('hyco-https');
Required for Express compatibility: set http.ServerResponse = https.ServerResponse before loading Express.

Creates a Relay listener URI, appends a token, and starts an HTTPS server through Azure Relay Hybrid Connection.

const https = require('hyco-https'); const listenUri = https.createRelayListenUri( process.env.RELAY_NAMESPACE || 'your-namespace.servicebus.windows.net', process.env.RELAY_PATH || 'hyco' ); const token = https.appendRelayToken(listenUri, process.env.RELAY_RULE_NAME || 'listener', process.env.RELAY_KEY || '' ); const server = https.createRelayedServer( { server: token }, (req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello from Azure Relay Hybrid Connections!\n'); } ); server.listen((err) => { if (err) { return console.log('Error:', err); } console.log(`Server listening on ${token}`); });
Debug
Known issues
gotchaCannot use hyco-https and Node's built-in https simultaneously in the same process; server behavior is overridden entirely.
fix
If you need local https, use a separate process or use only hyco-https for remote listening.
affects: >=1.0.0
gotchaExpress and other frameworks that override http.ServerResponse require manual assignment of https.ServerResponse before loading the framework.
fix
var http = require('http'); var https = require('hyco-https'); http.ServerResponse = https.ServerResponse; var express = require('express');
affects: >=1.0.0
breakingIn hyco-https, createServer does not support the full standard https.createServer options; use createRelayedServer instead.
fix
Use createRelayedServer(options, requestListener) where options includes the 'server' URI with token.
affects: >=1.0.0
deprecatedThe appendRelayToken helper returns a URI with embedded token; consider using Azure SDK policies instead of token manipulation.
fix
Use @azure/arm-relay SDK for token management if possible.
affects: >=1.0.0
Errors
Common errors & fixes
Error: listen EADDRINUSE :::443
Trying to listen on a local port while hyco-https is designed for remote relay; local port binding is not supported for relayed servers.
fix
Remove port number from server.listen() and pass only a callback. hyco-https creates a WebSocket listener, not a TCP socket.
TypeError: https.createServer is not a function
Using ES module import (import hycoHttps from 'hyco-https') instead of CommonJS require.
fix
Use const hycoHttp = require('hyco-https');
ReferenceError: require is not defined
Running in ES module context (type: module in package.json).
fix
Switch to CommonJS (remove type: module) or use createRequire from 'module'.
Upgrade
Version history
1.4.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
OpenAI (training)
1
Resources
hyco-https — npm install hyco-https · libregistry