mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 02:46:28 +00:00
Fix robosats on blixt's react-native-webview (#594)
This commit is contained in:
parent
8a04474934
commit
0797a7d1ef
@ -13,4 +13,8 @@ export interface SystemClient {
|
||||
}
|
||||
|
||||
export const systemClient: SystemClient =
|
||||
window.ReactNativeWebView != null ? new SystemNativeClient() : new SystemWebClient();
|
||||
// If userAgent has "RoboSats", we assume the app is running inside of the
|
||||
// react-native-web view of the RoboSats Android app.
|
||||
window.navigator.userAgent.includes('robosats')
|
||||
? new SystemNativeClient()
|
||||
: new SystemWebClient();
|
||||
|
@ -5,6 +5,7 @@ import TorClient from './services/Tor';
|
||||
import Clipboard from '@react-native-clipboard/clipboard';
|
||||
import NetInfo from '@react-native-community/netinfo';
|
||||
import EncryptedStorage from 'react-native-encrypted-storage';
|
||||
import { name as app_name, version as app_version } from './package.json';
|
||||
|
||||
const backgroundColors = {
|
||||
light: 'white',
|
||||
@ -157,6 +158,7 @@ const App = () => {
|
||||
}}
|
||||
onMessage={onMessage}
|
||||
// @ts-expect-error
|
||||
userAgent={`${app_name} v${app_version} Android`}
|
||||
style={{ backgroundColor: backgroundColors[colorScheme] }}
|
||||
ref={(ref) => (webViewRef.current = ref)}
|
||||
overScrollMode='never'
|
||||
|
@ -14,6 +14,7 @@ http {
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
large_client_header_buffers 4 64K;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
|
@ -6,8 +6,11 @@
|
||||
# 2) nginx: does the magic of redirecting every request to either local (the app, static,
|
||||
# languages) or remote (for each coordinator, either API or WS, and static avatar)
|
||||
|
||||
# Every robosat coordinators needs a tor bridge. So far only experimental coordinator available.
|
||||
# Every robosat coordinators needs a tor socat bridge. So far only experimental coordinator available.
|
||||
experimental_onion=robosats6tkf3eva7x2voqso3a5wcorsnw34jveyxfqi2fu7oyheasid.onion
|
||||
experimental_socat="socat tcp4-LISTEN:81,reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${experimental_onion}:80,socksport=${TOR_PROXY_PORT:-9050}"
|
||||
experimental_port=81
|
||||
# ... add more
|
||||
|
||||
experimental_socat="socat tcp4-LISTEN:${experimental_port},reuseaddr,fork,keepalive,bind=127.0.0.1 SOCKS4A:${TOR_PROXY_IP:-127.0.0.1}:${experimental_onion}:80,socksport=${TOR_PROXY_PORT:-9050}"
|
||||
|
||||
$experimental_socat & nginx
|
Loading…
Reference in New Issue
Block a user