https://github.com/dcsunset/socks5-protocol
A Node.js library (in TypeScript and ESM) to encode/decode messages in SOCKS5 protocol.
https://github.com/dcsunset/socks5-protocol
encoding network nodejs protocol socks5 typescript
Last synced: 3 months ago
JSON representation
A Node.js library (in TypeScript and ESM) to encode/decode messages in SOCKS5 protocol.
- Host: GitHub
- URL: https://github.com/dcsunset/socks5-protocol
- Owner: DCsunset
- License: apache-2.0
- Created: 2024-03-19T22:01:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-25T01:42:47.000Z (about 1 year ago)
- Last Synced: 2025-02-01T10:17:49.649Z (4 months ago)
- Topics: encoding, network, nodejs, protocol, socks5, typescript
- Language: TypeScript
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# socks5-protocol
[](https://www.npmjs.com/package/socks5-protocol)
[](https://github.com/DCsunset/socks5-protocol)A Node.js library (in TypeScript and ESM) to encode/decode messages in SOCKS5 protocol.
## Installation
```
npm i socks5-protocol
```## Usage
The naming of message types mostly follows the [RFC 1928](https://www.rfc-editor.org/rfc/rfc1928).
Here a list of implemented messages:
- `AuthReq`: The message from client for auth method selection
- `AuthResp`: Server's response to `AuthReq`
- `ConnReq`: The message from client to request a connection, binding, or association
- `ConnResp`: Server's response to `ConnReq`
- `UdpReq`: Message for UDP communication between server and clientAll the above message types have corresponding encoding and decoding functions.
A `SockError` will be thrown when encoding/decoding fails.## License
Apache-2.0
```
Copyright 2024 DCsunsetLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```