-
Notifications
You must be signed in to change notification settings - Fork 114
feat: add listen address configuration option #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -71,10 +71,16 @@ export default { | |||||
| changePort: '修改端口', | ||||||
| port: '端口', | ||||||
| portLabel: '端口号 (1-65535):', | ||||||
| portNote: '注意:修改端口号需要重启应用', | ||||||
| listenAddrLabel: '监听地址:', | ||||||
| listenAddrPlaceholder: '例如:127.0.0.1', | ||||||
| listenAddrPresetPublic: '公网 0.0.0.0', | ||||||
| listenAddrPresetLAN: '局域网 192.168.0.0', | ||||||
|
||||||
| listenAddrPresetLAN: '局域网 192.168.0.0', | |
| listenAddrPresetLAN: '局域网 192.168.0.1', |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| import { t } from '../i18n/index.js'; | ||||||
| import { escapeHtml } from '../utils/format.js'; | ||||||
| import { addEndpoint, updateEndpoint, removeEndpoint, testEndpoint, testEndpointLight, updatePort } from './config.js'; | ||||||
| import { addEndpoint, updateEndpoint, removeEndpoint, testEndpoint, testEndpointLight, updateNetwork } from './config.js'; | ||||||
|
||||||
| import { addEndpoint, updateEndpoint, removeEndpoint, testEndpoint, testEndpointLight, updateNetwork } from './config.js'; | |
| import { addEndpoint, updateEndpoint, removeEndpoint, testEndpointLight, updateNetwork } from './config.js'; |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation only checks for empty values and whitespace. Consider validating that the listen address is a valid IP address or hostname. Invalid addresses like "999.999.999.999" or malformed hostnames will pass this check and only fail at runtime when the server attempts to bind.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -442,6 +442,15 @@ export function initUI() { | |||||
| <label><span class="required">*</span>${t('modal.portLabel')}</label> | ||||||
| <input type="number" id="portInput" min="1" max="65535" placeholder="3000"> | ||||||
| </div> | ||||||
| <div class="form-group"> | ||||||
| <label><span class="required">*</span>${t('modal.listenAddrLabel')}</label> | ||||||
| <input type="text" id="listenAddrInput" placeholder="${t('modal.listenAddrPlaceholder')}"> | ||||||
| <div class="listen-addr-presets"> | ||||||
| <button class="preset-chip" onclick="window.setListenAddrPreset('0.0.0.0')">${t('modal.listenAddrPresetPublic')}</button> | ||||||
| <button class="preset-chip" onclick="window.setListenAddrPreset('192.168.0.0')">${t('modal.listenAddrPresetLAN')}</button> | ||||||
|
||||||
| <button class="preset-chip" onclick="window.setListenAddrPreset('192.168.0.0')">${t('modal.listenAddrPresetLAN')}</button> | |
| <button class="preset-chip" onclick="window.setListenAddrPreset('192.168.0.1')">${t('modal.listenAddrPresetLAN')}</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The preset value '192.168.0.0' is a network address, not a valid host IP to bind to. This should likely be '192.168.0.1' or another valid host address in the private range. Binding to .0.0 addresses (network addresses) may fail or produce unexpected behavior depending on the OS.