Skip to content

Commit

Permalink
修改默认端口为12450
Browse files Browse the repository at this point in the history
  • Loading branch information
xfgryujk committed Jul 10, 2019
1 parent d0fd997 commit f2d2528
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ RUN npm run build

# 运行
WORKDIR /blivechat
EXPOSE 80
EXPOSE 12450
ENTRYPOINT ["python3", "main.py"]
CMD ["--host", "0.0.0.0", "--port", "80"]
CMD ["--host", "0.0.0.0", "--port", "12450"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
1. 下载[发布版](https://github.com/xfgryujk/blivechat/releases)(仅提供x64 Windows版)
2. 双击`blivechat.exe`运行服务器,或者用命令行可以指定host和端口号:
```bat
blivechat.exe --host 127.0.0.1 --port 80
blivechat.exe --host 127.0.0.1 --port 12450
```
3. 用浏览器打开[http://localhost](http://localhost),输入房间ID,保存配置,进入房间,复制房间URL
4. (可选)用样式生成器生成样式,复制CSS
Expand All @@ -39,14 +39,14 @@
```
或者可以指定host和端口号:
```sh
python3 main.py --host 127.0.0.1 --port 80
python3 main.py --host 127.0.0.1 --port 12450
```
3. 用浏览器打开[http://localhost](http://localhost),输入房间ID,保存配置,进入房间,复制房间URL
4. (可选)用样式生成器生成样式,复制CSS
5. 在OBS中添加浏览器源,输入URL和自定义CSS,或者可以在首页的样式设置里输入CSS

### Docker
1. ```sh
docker run -d -p 80:80 xfgryujk/blivechat:latest
docker run -d -p 12450:12450 xfgryujk/blivechat:latest
```
2. 以下略
4 changes: 2 additions & 2 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import ja from './lang/ja'
import en from './lang/en'

if (process.env.NODE_ENV === 'development') {
// 开发时使用localhost:80
axios.defaults.baseURL = 'http://localhost'
// 开发时使用localhost:12450
axios.defaults.baseURL = 'http://localhost:12450'
}

Vue.use(VueRouter)
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/Room.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default {
}
},
async created() {
// 开发时使用localhost:80
const url = process.env.NODE_ENV === 'development' ? 'ws://localhost/chat' : `ws://${window.location.host}/chat`
// 开发时使用localhost:12450
const url = process.env.NODE_ENV === 'development' ? 'ws://localhost:12450/chat' : `ws://${window.location.host}/chat`
this.websocket = new WebSocket(url)
this.websocket.onopen = this.onWsOpen.bind(this)
this.websocket.onmessage = this.onWsMessage.bind(this)
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
def main():
parser = argparse.ArgumentParser(description='用于OBS的仿YouTube风格的bilibili直播聊天层')
parser.add_argument('--host', help='服务器host,默认为127.0.0.1', default='127.0.0.1')
parser.add_argument('--port', help='服务器端口,默认为80', type=int, default=80)
parser.add_argument('--port', help='服务器端口,默认为12450', type=int, default=12450)
parser.add_argument('--debug', help='调试模式', action='store_true')
args = parser.parse_args()

Expand Down

1 comment on commit f2d2528

@simon300000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12450...

Please sign in to comment.