Skip to content

Commit

Permalink
fix: not export object from linux
Browse files Browse the repository at this point in the history
  • Loading branch information
anonysoul committed Jan 31, 2024
1 parent 4eef6b0 commit df93215
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,25 @@ MacProxied.enable(config);
Set up proxy on Linux:

```typescript
import { LinuxProxied, LinuxProxyConfig } from "net-proxied";
import { Authentication, BaseProxyConfig, LinuxProxied, LinuxProxyConfig } from "net-proxied";

const baseProxy: BaseProxyConfig = {
hostname: "10.20.30.11",
port: 1111
hostname: "10.20.30.40",
port: 5060
};

const authentication: Authentication = {
username: "username",
password: "password"
};

const config: LinuxProxyConfig = {
http: baseProxy,
https: baseProxy,
ftp: baseProxy,
socks: baseProxy,
noProxy: ["localhost", "192.168.*", "10.*"]
noProxy: ["localhost", "192.168.*", "10.*"],
authentication: authentication
};

LinuxProxied.enable(config);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "net-proxied",
"version": "1.0.3",
"version": "1.0.4",
"description": "Set system proxy for operating system, supporting MAC and Windows.",
"main": "index.js",
"types": "index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/authentication.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Authentication {
username: string;
password: string;
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from "./platform/windows";
export * from "./authentication";
export * from "./platform/linux";
export * from "./platform/mac";
export * from "./platform/windows";
6 changes: 1 addition & 5 deletions src/platform/linux.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { Authentication } from "../authentication";
import { BaseProxyConfig } from "../base-proxy-config";
import { Executor } from "../executor";

export type LinuxDesktopType = "GNOME" | "KDE" | "MATE";
export type LinuxProxyType = "http" | "https" | "ftp" | "socks";

export interface Authentication {
username: string;
password: string;
}

export class LinuxProxyConfig {
http?: BaseProxyConfig;
https?: BaseProxyConfig;
Expand Down
6 changes: 1 addition & 5 deletions src/platform/mac.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Authentication } from "../authentication";
import { BaseProxyConfig } from "../base-proxy-config";
import { Executor } from "../executor";

Expand All @@ -24,11 +25,6 @@ export class MacProxyConfig implements BaseProxyConfig {
types: MacProxyType[];
}

export interface Authentication {
username: string;
password: string;
}

export interface NetworkService {
name: string;
enabled: boolean;
Expand Down

0 comments on commit df93215

Please sign in to comment.