Compare commits
2 Commits
7cfb0e482f
...
v0.2.1
Author | SHA1 | Date | |
---|---|---|---|
ca434c918b | |||
f8372b8de8 |
@ -25,8 +25,7 @@ COPY --from=frontend-builder /app/frontend/dist /usr/share/nginx/html
|
|||||||
COPY --from=backend-builder /app/ushare /usr/local/bin/ushare
|
COPY --from=backend-builder /app/ushare /usr/local/bin/ushare
|
||||||
|
|
||||||
# 配置 Nginx
|
# 配置 Nginx
|
||||||
RUN rm /etc/nginx/conf.d/default.conf
|
COPY deployment/nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY deployment/nginx.conf /etc/nginx/conf.d
|
|
||||||
COPY deployment/entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY deployment/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
|
@ -1,3 +1,26 @@
|
|||||||
|
user root;
|
||||||
|
worker_processes auto;
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
@ -15,9 +38,13 @@ server {
|
|||||||
|
|
||||||
location /ushare {
|
location /ushare {
|
||||||
proxy_pass http://localhost:9119;
|
proxy_pass http://localhost:9119;
|
||||||
const rtc = new RTCPeerConnection({iceServers: [{urls: "stun:stun.qq.com:3478"}]})
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_max_temp_file_size 0;
|
||||||
|
proxy_request_buffering off;
|
||||||
|
proxy_buffering off;
|
||||||
|
client_max_body_size 5M;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,8 +55,8 @@ const useClass = createUseStyles({
|
|||||||
|
|
||||||
export const LocalSharing: React.FC = () => {
|
export const LocalSharing: React.FC = () => {
|
||||||
const classes = useClass();
|
const classes = useClass();
|
||||||
const {id, name, set, setChannel} = useLocalStore();
|
const {id, name, set, } = useLocalStore();
|
||||||
const [rtc, setRTC] = useState<RTCPeerConnection>();
|
const [_rtc, setRTC] = useState<RTCPeerConnection>();
|
||||||
const rtcRef = useRef<RTCPeerConnection | null>(null);
|
const rtcRef = useRef<RTCPeerConnection | null>(null);
|
||||||
const [clients, setClients] = useState<Client[]>([]);
|
const [clients, setClients] = useState<Client[]>([]);
|
||||||
const {connect, close} = useWebsocket({});
|
const {connect, close} = useWebsocket({});
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {createUseStyles} from "react-jss";
|
import {createUseStyles} from "react-jss";
|
||||||
import {Dialog} from "../../component/dialog/dialog.tsx";
|
|
||||||
|
|
||||||
const useClass = createUseStyles({
|
const useClass = createUseStyles({
|
||||||
container: {}
|
container: {}
|
||||||
})
|
})
|
||||||
export const TestPage = () => {
|
export const TestPage = () => {
|
||||||
const classes = useClass()
|
const classes = useClass()
|
||||||
const [open, setOpen] = useState<boolean>(false)
|
const [_open, setOpen] = useState<boolean>(false)
|
||||||
|
|
||||||
const handleOpen = () => {
|
const handleOpen = () => {
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
@ -15,8 +14,5 @@ export const TestPage = () => {
|
|||||||
|
|
||||||
return <div className={classes.container}>
|
return <div className={classes.container}>
|
||||||
<button onClick={handleOpen}>open</button>
|
<button onClick={handleOpen}>open</button>
|
||||||
<Dialog open={open} title="hello world" >
|
|
||||||
<input />
|
|
||||||
</Dialog>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ export interface LocalStore {
|
|||||||
setChannel: (chan?: RTCDataChannel) => void;
|
setChannel: (chan?: RTCDataChannel) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useLocalStore = create<LocalStore>()((_set, get) => ({
|
export const useLocalStore = create<LocalStore>()((_set, _get) => ({
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
set: (id: string, name: string) => {
|
set: (id: string, name: string) => {
|
||||||
|
Reference in New Issue
Block a user