Skip to content

Commit

Permalink
fix ios12
Browse files Browse the repository at this point in the history
  • Loading branch information
刘豪杰 authored and 刘豪杰 committed Apr 12, 2019
1 parent 0c9cc83 commit 3943b43
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
4 changes: 3 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ Load the game and enjoy it~

## Notie in IOS 12.2+

If you are using ios 12.2+, please enable 'Settings > Safari > Motion and Orientation access' and use HTTPS to access
If you are using ios 12.2+, please enable 'Settings > Safari > Motion and Orientation access' and use HTTPS to access.

Since safari's websocket does not support self-signed certificates, when using HTTPS access, socket.io will probably use XHR instead of websocket, which will increase communication latency.

## Quote

Expand Down
8 changes: 4 additions & 4 deletions app.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const fs = require("fs");
const path = require("path");

var https = require('https');
var privateKey = fs.readFileSync('ssl/private.pem', 'utf8');
var certificate = fs.readFileSync('ssl/file.crt', 'utf8');
var privateKey = fs.readFileSync(__dirname+'/ssl/private.pem', 'utf8');
var certificate = fs.readFileSync(__dirname+'/ssl/file.crt', 'utf8');
var credentials = { key: privateKey, cert: certificate };

const server = dgram.createSocket("udp4");
Expand All @@ -25,7 +25,7 @@ const MessageType = {
DSUC_PadDataReq: 0x100002,
DSUS_PadDataRsp: 0x100002
};
const serverID = 0 + Math.floor(Math.random() * 9007199254740992);
const serverID = 0 + Math.floor(Math.random() * 4294967295);
console.log(`serverID: ${serverID}`);

var connectedClient = null;
Expand Down Expand Up @@ -329,7 +329,7 @@ var httpServer = http.createServer(
httpServer.listen(8080, function () {
console.log(`
----------------------------------------
Version 1.5 by hjmmc
Version 1.6 by hjmmc
-----------------------------------------
##Usage
Expand Down
3 changes: 3 additions & 0 deletions package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"scripts": {
"start": "node app.js"
},
"pkg": {
"assets": "ssl/**/*"
},
"repository": {
"type": "git",
"url": "git+https://github.com/denismr/iOSGyroForCemuhook.git"
Expand Down
19 changes: 16 additions & 3 deletions static.html
100644 → 100755

Large diffs are not rendered by default.

0 comments on commit 3943b43

Please sign in to comment.