Skip to content

Commit

Permalink
correct unix socket connection
Browse files Browse the repository at this point in the history
  • Loading branch information
peuter committed Jan 30, 2024
1 parent e23833e commit 2603507
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/addon/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function getAgent(url: string, basePath: string) {
const apiPath = parsedUrl.pathname;
if (!socketAgents.has(apiPath)) {
console.log('creating unix socket agent for', apiPath);
const unixSocketAgent = new http.Agent(<object>{
socketPath: "/run" + apiPath,
const unixSocketAgent = new http.Agent({
host: "ws+unix:///run" + apiPath + ":" + apiPath
});
socketAgents.set(apiPath, unixSocketAgent);
return unixSocketAgent;
Expand Down
4 changes: 2 additions & 2 deletions src/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function getAgent(url: string, basePath: string) {
const apiPath = parsedUrl.pathname;
if (!socketAgents.has(apiPath)) {
console.log('creating unix socket agent for', apiPath);
const unixSocketAgent = new http.Agent(<object>{
socketPath: "/run" + apiPath,
const unixSocketAgent = new http.Agent({
host: "ws+unix:///run" + apiPath + ":" + apiPath
});
socketAgents.set(apiPath, unixSocketAgent);
return unixSocketAgent;
Expand Down
4 changes: 2 additions & 2 deletions src/fhapi/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function getAgent(url: string, basePath: string) {
const apiPath = parsedUrl.pathname;
if (!socketAgents.has(apiPath)) {
console.log('creating unix socket agent for', apiPath);
const unixSocketAgent = new http.Agent(<object>{
socketPath: "/run" + apiPath,
const unixSocketAgent = new http.Agent({
host: "ws+unix:///run" + apiPath + ":" + apiPath
});
socketAgents.set(apiPath, unixSocketAgent);
return unixSocketAgent;
Expand Down
4 changes: 2 additions & 2 deletions src/rpc/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function getAgent(url: string, basePath: string) {
const apiPath = parsedUrl.pathname;
if (!socketAgents.has(apiPath)) {
console.log('creating unix socket agent for', apiPath);
const unixSocketAgent = new http.Agent(<object>{
socketPath: "/run" + apiPath,
const unixSocketAgent = new http.Agent({
host: "ws+unix:///run" + apiPath + ":" + apiPath
});
socketAgents.set(apiPath, unixSocketAgent);
return unixSocketAgent;
Expand Down
4 changes: 2 additions & 2 deletions src/serial/core/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ function getAgent(url: string, basePath: string) {
const apiPath = parsedUrl.pathname;
if (!socketAgents.has(apiPath)) {
console.log('creating unix socket agent for', apiPath);
const unixSocketAgent = new http.Agent(<object>{
socketPath: "/run" + apiPath,
const unixSocketAgent = new http.Agent({
host: "ws+unix:///run" + apiPath + ":" + apiPath
});
socketAgents.set(apiPath, unixSocketAgent);
return unixSocketAgent;
Expand Down

0 comments on commit 2603507

Please sign in to comment.