Skip to content

Conversation

@rbtying
Copy link
Owner

@rbtying rbtying commented Sep 17, 2025

When WASM is not available, the application falls back to RPC calls for game mechanics. However, the RPC calls were always using the relative path '/api/rpc' and ignoring the WEBSOCKET_HOST environment variable.

This fix ensures that:

  • RPC calls respect WEBSOCKET_HOST when it's set
  • WebSocket URLs (wss://, ws://) are properly converted to HTTP URLs (https://, http://)
  • The correct /api/rpc path is appended based on the URL structure
  • Comprehensive tests verify the URL construction for both WebSocket and RPC

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

🏠 Remote-Dev: homespace

When WASM is not available, the application falls back to RPC calls for game
mechanics. However, the RPC calls were always using the relative path '/api/rpc'
and ignoring the WEBSOCKET_HOST environment variable.

This fix ensures that:
- RPC calls respect WEBSOCKET_HOST when it's set
- WebSocket URLs (wss://, ws://) are properly converted to HTTP URLs (https://, http://)
- The correct /api/rpc path is appended based on the URL structure
- Comprehensive tests verify the URL construction for both WebSocket and RPC

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

:house: Remote-Dev: homespace
- Fixed prefer-const lint error in WasmOrRpcProvider.test.tsx
- Applied prettier formatting to both test files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

:house: Remote-Dev: homespace
@rbtying rbtying merged commit 4fa93eb into master Sep 17, 2025
4 checks passed
@rbtying rbtying deleted the fix-websocket-host-rpc branch September 17, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants