﻿AmaGris 세션 공유 서버 (Windows) v1.5.0
==================================================

AmaGris 세션 공유에 쓰는 중계 서버입니다. 내 PC·공유 PC·회사 서버에서 직접 띄웁니다. 내 PC 에서 띄우면 같은 PC 의
AmaGris 는 [로컬 서버](ws://localhost:4840), 같은 네트워크의 다른 PC·폰은 ws://<이 PC IP>:4840 으로 붙습니다.

실행 순서
1. zip 을 통째로 풀어 amagris-share 폴더를 원하는 곳에 둡니다(amagris-share.exe 옆에 app 폴더가 있어야 합니다 · zip 안에서 바로 실행하지 마세요).
2. 필요하면 config.sample.json 을 config.json 으로 복사해 고칩니다(아래 "설정" · 같은 PC·같은 네트워크에서만 쓰면 없어도 됩니다).
3. amagris-share.exe 를 실행합니다. SmartScreen 경고가 뜨면 [추가 정보] → [실행], Windows 방화벽이 물으면 [허용]을 누릅니다.
4. 콘솔에 찍힌 "AmaGris 설정창에 등록할 주소"를 AmaGris Option → Session Sharing Servers... 에 등록합니다(ws:// 주소면 "ws:// 허용" 체크).
5. 콘솔 창을 닫으면(또는 Ctrl+C) 공유 서버가 꺼집니다. data 폴더에는 호스트 신원·공유 매핑만 남습니다(채팅 내용은 저장하지 않습니다).

설정 - config.json (이 폴더 · 없거나 비운 키는 기본값 · 경로는 C:/certs/fullchain.pem 처럼 / 로 적습니다)
  siteUrl            공유 링크·QR 에 찍히는 주소(뷰어가 여는 주소). Windows 실행파일 기본 = http://<이 PC 의 LAN IPv4>:<port> 자동.
                     공개 주소로 운영하려면 도메인과 https 로 지정합니다(예: https://share.example.com:4840).
  https, tls         "https": true 와 "tls": { "cert": "<fullchain.pem>", "key": "<privkey.pem>" } 이면 https/wss 로 받습니다
                     (AmaGris 에는 wss://<도메인>:<port> 로 등록 · 사설 인증서면 설정창 [연결 테스트] → [이 서버 신뢰]).
  registrationToken  두면 AmaGris 설정창의 등록 토큰 칸에 같은 값을 넣은 PC 만 이 서버에 등록됩니다.
  port               포트(기본 4840).

Linux 서버에는 같은 다운로드 페이지의 amagris-share-<버전>.tar.gz(Node 패키지 · start.sh)를 씁니다.


AmaGris Session Sharing Server (Windows) v1.5.0
==================================================

The relay server used by AmaGris session sharing. Run it yourself on your PC, a shared PC or a company server. Run it on your PC and
AmaGris on the same PC connects with [로컬 서버] (ws://localhost:4840), other PCs and phones on the network with ws://<this PC IP>:4840.

Steps
1. Extract the whole zip and put the amagris-share folder anywhere (the app folder must sit next to amagris-share.exe; do not run it from inside the zip).
2. If needed, copy config.sample.json to config.json and edit it (see "Settings"; not needed on the same PC or network).
3. Run amagris-share.exe. If SmartScreen warns, click More info -> Run anyway; if Windows Firewall asks, click Allow.
4. Register the address printed in the console in AmaGris: Option -> Session Sharing Servers... (for a ws:// address, check "ws:// 허용").
5. Closing the console window (or Ctrl+C) stops the server. The data folder keeps only host identities and share mappings (no chat content).

Settings - config.json (this folder; missing or empty keys use defaults; write paths with /, e.g. C:/certs/fullchain.pem)
  siteUrl            Address printed in share links and QR codes (what viewers open). Windows default: http://<LAN IPv4 of this PC>:<port>.
                     To serve on a public address, use a domain with https (e.g. https://share.example.com:4840).
  https, tls         "https": true with "tls": { "cert": "<fullchain.pem>", "key": "<privkey.pem>" } serves https/wss
                     (register wss://<domain>:<port> in AmaGris; for a private certificate use [연결 테스트] -> [이 서버 신뢰]).
  registrationToken  When set, only PCs that enter the same registration token in AmaGris settings can register.
  port               Port (default 4840).

For a Linux server use amagris-share-<version>.tar.gz (Node package, start.sh) from the same download page.
